Back to skill

Security audit

pm-proto-prd-pin

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious because it reports significant security and data-handling concerns, while some files and checks were only partially analyzed.

Treat this as a review warning and weigh the reported data exposure, unauthorized changes, installation impact, and script-injection risks before installing. The scanner did not establish malicious intent, but its analysis was incomplete, so the unreviewed or partially interpreted content remains uncertain.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
assets/server.js:61
Finding

Unauthenticated network clients can overwrite persistent PRD data ## Remediation Suggestions - Bind to `127.0.0.1` by default and require explicit configuration for remote access. - Enforce authentication and page-level authorization on every write request. - Replace wildcard CORS with an explicit trusted-origin policy. Treat origin validation as an additional control, not a substitute for authentication. - Validate the request schema and allowed page identifiers before writing files. - Enforce request-size limits and retain recoverable revisions of overwritten data.

Content
View full analysis

Vulnerability Details

File Location: assets/server.js:61–98,135
Vulnerability Type: Missing server-side authentication and authorization
Risk Level: High

Technical Analysis

The HTTP server permits requests from any origin and writes caller-supplied PRD records without authenticating the caller.

javascript
const server = http.createServer((req, res) => {
  res.setHeader('Access-Control-Allow-Origin', '*');
  res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
  res.setHeader('Access-Control-Allow-Headers', 'Content-Type');

  if (req.method === 'OPTIONS') {
    res.writeHead(204);
    res.end();
    return;
  }

  const parsed = new URL(req.url, `http://${req.headers.host}`);
  const pathname = decodeURIComponent(parsed.pathname);

  if (pathname === '/api/save-prd' && req.method === 'POST') {
    let body = '';
    req.on('data', chunk => { body += chunk; });
    req.on('end', () => {
      try {
        const payload = JSON.parse(body);

The write path uses request-controlled page identifiers and record contents:

javascript
const jsDir = path.join(BASE_DIR, 'assets', 'js');
fs.mkdirSync(jsDir, { recursive: true });
const clean = safeName(payload.page);
const htmlName = clean + '.html';
const file = path.join(jsDir, `prd-data-${clean}.js`);
fs.writeFileSync(file, buildDataFile(htmlName, payload.data, payload.versionRegistry), 'utf-8');

if (payload.allData && typeof payload.allData === 'object') {
  fs.writeFileSync(path.join(jsDir, 'prd-data-all.json'), JSON.stringify(payload.allData, null, 2), 'utf-8');
}

The listener does not specify a loopback host:

javascript
server.listen(PORT, () => {

Consequently, the service is not restricted to localhost by default. Actual remote reachability depends on operating-system networking and firewall rules. The frontend editor restrictions do not protect this direct HTTP endpoint.

Attack Path

  1. The user starts the supplied local persistence server.
  2. A ...[truncated 1010 chars]

T09 · Insecure Skill Coding Practices

Error
Location
assets/server.js:115
Finding

Static-file containment check permits reads outside the served directory ## Remediation Suggestions - Resolve the real paths of both the static root and requested file before serving content. - Use `path.relative(realRoot, realFile)` to enforce directory-component containment; reject absolute relative results, `..`, and paths beginning with `..` followed by a separator. - Reject external symlink targets or explicitly disallow symlinks. - Serve only designated public assets rather than the entire project directory. - Add regression tests for encoded separators, same-prefix sibling directories, and symlink escapes.

Content
View full analysis

Vulnerability Details

File Location: assets/server.js:72–73,115–131
Vulnerability Type: Directory traversal through an insufficient path-boundary check
Risk Level: High

Technical Analysis

The server decodes URL path components before joining them to the static root:

javascript
const parsed = new URL(req.url, `http://${req.headers.host}`);
const pathname = decodeURIComponent(parsed.pathname);

It then checks containment using a textual prefix rather than filesystem directory boundaries:

javascript
let relative = pathname === '/' || pathname === '' ? '/index.html' : pathname;
const filePath = path.join(BASE_DIR, relative);
if (!filePath.startsWith(BASE_DIR)) {
  res.writeHead(403);
  res.end('Access Denied');
  return;
}

An existing file that passes the check is streamed to the requester:

javascript
res.writeHead(200, { 'Content-Type': MIME_TYPES[path.extname(filePath).toLowerCase()] || 'application/octet-stream' });
fs.createReadStream(filePath).pipe(res);

A sibling directory whose name begins with the served root’s name passes this check. The server also follows filesystem symlinks without checking whether their resolved targets remain inside the root.

Attack Path

  1. The user runs the server with a static root such as /x/proto.
  2. An attacker who can reach the server identifies an existing readable file such as /x/proto-private/secret.txt.
  3. The attacker requests /..%2fproto-private/secret.txt.
  4. URL decoding produces /../proto-private/secret.txt.
  5. path.join() resolves the file to /x/proto-private/secret.txt.
  6. The path passes startsWith('/x/proto'), and the server returns the file.

The example paths illustrate the source-level bypass; the audit did not establish that these particular files exist.

Impact Assessment

An unauthenticated requester can read files outside the intended static root when they reside in a same-prefix sibling directory and are readable by the server process. ...[truncated 189 chars]

T09 · Insecure Skill Coding Practices

Warning
Location
assets/server.js:72
Finding

Malformed percent encoding can terminate the HTTP service ## Remediation Suggestions - Wrap URL construction and percent decoding in request-level exception handling. - Return HTTP 400 for malformed URLs and stop processing that request. - Add tests for incomplete percent escapes and invalid encoded sequences. - Avoid relying on a global uncaught-exception handler as the primary request-validation mechanism.

Content
View full analysis

Vulnerability Details

File Location: assets/server.js:61,72–73
Vulnerability Type: Uncaught request-parsing exception
Risk Level: Medium

Technical Analysis

URL decoding occurs directly inside the HTTP request callback:

javascript
const server = http.createServer((req, res) => {
javascript
const parsed = new URL(req.url, `http://${req.headers.host}`);
const pathname = decodeURIComponent(parsed.pathname);

A malformed percent-encoded pathname causes decodeURIComponent() to throw a URIError. This operation is outside the POST handler’s exception handling.

Attack Path

  1. The user starts the supplied server.
  2. An unauthenticated client with access to its port sends a request with a malformed pathname, such as /%.
  3. decodeURIComponent() throws while processing the request.
  4. Under default Node.js uncaught-exception behavior, the exception terminates the process.

Impact Assessment

A single malformed request can interrupt prototype viewing and persistence until the service is restarted. The attacker crosses the boundary between untrusted HTTP syntax and process availability.

This conclusion assumes default Node.js exception handling and was not runtime-tested.

T09 · Insecure Skill Coding Practices

Error
Location
assets/prd-pin-tool.js:3953
Finding

Stored Markdown descriptions can execute scripts in another viewer’s origin ## Remediation Suggestions - Construct image and link elements using DOM APIs rather than interpolating untrusted strings into HTML. - Validate URL schemes and restrict them to explicitly supported protocols. - Sanitize final rendered HTML with a maintained allowlist sanitizer that removes event-handler attributes and unsafe elements or URLs. - Apply equivalent protections to drawer snippets, full-document output, and Mermaid rendering. - Fix the unauthenticated persistence endpoint independently; authenticated content authors must not automatically receive script-execution privileges in viewers’ browsers. - Add regression tests for quotation-mark attribute breakouts, unsafe link schemes, and malicious content loaded from persistent records.

Content
View full analysis

Vulnerability Details

File Location: assets/prd-pin-tool.js:3953–3968,5995–6011,6081–6100
Related Entry Point: assets/server.js:75–90
Vulnerability Type: Stored cross-site scripting through Markdown attribute injection
Risk Level: High

Technical Analysis

The Markdown formatter escapes HTML delimiters but not quotation marks before interpolating Markdown captures into HTML attributes:

javascript
function formatInline(str) {
  if (!str) return '';
  let s = str
    .replace(/&/g, "&")
    .replace(/</g, "&lt;")
    .replace(/>/g, "&gt;");

  s = s.replace(/__PRD_INLINE_CODE_(\d+)__/g, (m, id) => inlineCodes[id] || '');
  s = s.replace(/__PRD_CODE_BLOCK_(\d+)__/g, (m, id) => codeBlocks[id] || '');

  // Image conversion:

The vulnerable replacement statements are:

javascript
s = s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, '<img src="$2" alt="$1" class="prd-md-img">');
javascript
s = s.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>');

Descriptions enter this parser through renderDescSnippet():

javascript
let html = parseMarkdown(md) || '';

The drawer inserts the resulting markup into its HTML template:

javascript
<div class="prd-card-desc" title="${escapeHtml(stripMarkdownSnippet(pin.desc))}">
  ${renderDescSnippet(pin.desc)}
</div>

The completed template reaches an HTML interpretation sink:

javascript
container.innerHTML = html;

Escaping the separate title attribute does not sanitize the description markup. The snippet transformation preserves images and does not remove injected event-handler attributes.

Attack Path

  1. An attacker uses the unauthenticated save endpoint to replace a page’s PRD data.
  2. The attacker includes a pin description containing:
    markdown
    ![x](x" onerror="alert`1`)
    
  3. The image replacement produces:
    html
    <img src="x" onerror="alert`1`" alt="x" class="prd-md-img">
    
  4. Another user loads the affec ...[truncated 850 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (30)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The reported drop-handler path permits visitor-side grouping changes without authorization checks, while immediate cloud saves bypass the advertised unified confirmation boundary. These behaviors undermine annotation integrity and informed saving, but the underlying JavaScript is not included here, and the report does not establish that visitors can bypass server-side Bearer authentication.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
| `assets/prd-pin-tool.js` | 核心引擎。抽屉、气泡、编辑器、圆点、定位、持久化、导出、权限、i18n、默认 CSS。 |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 38)May include surrounding context.

md
| `assets/prd-groups.js` | 分组扩展层。由核心引擎 loader 动态加载。 |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 40)May include surrounding context.

md
| `assets/server.js` | 零依赖本地持久化服务。 |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 82)May include surrounding context.

md
本地相对路径:`assets/images/screenshot_drawer_overview.png` 等四个文件。全部为占位文案,无姓名、公司、项目信息。

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · assets/prd-pin-tool.js (reported line 277)May include surrounding context.

js
kvSyncSuccessToast: 'Specifications persisted to cloud KV store in real-time!',
      kvPullSuccessToast: 'Pulled and synced latest specifications from cloud KV!',
      ghModalTitle: 'GitHub Pages Owner Authentication & Cloud Sync',
      ghModalDesc: 'Configure a Fine-Grained Personal Access Token (PAT) for this prototype to unlock <strong>[Serverless, Direct Commit to GitHub]</strong> real-time cloud persistence.',
      ghOwnerLabel: 'Repository Owner',
      ghRepoLabel: 'Repository Name',
      ghBranchLabel: 'Target Branch',

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · assets/prd-pin-tool.js (reported line 281)May include surrounding context.

js
ghOwnerLabel: 'Repository Owner',
      ghRepoLabel: 'Repository Name',
      ghBranchLabel: 'Target Branch',
      ghTokenLabel: 'GitHub Access Token (PAT)',
      ghTokenPlaceholder: 'Paste github_pat_xxxx or ghp_xxxx',
      ghTokenGuideTitle: 'How to generate your Token (3 steps):',
      ghTokenStep1: '1. Click the direct link to open GitHub Token creation page;',

Origin-wide session credentials bypass the documented cross-project Cloudflare gateway isolation.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The origin-wide prd_cf_session_key overrides the project-specific Cloudflare key and marks the configuration verified without checking which gateway issued or validated that credential. Opening another project on the same origin can therefore cause the first project's administrator secret to be sent to a different configured gateway, bypassing the gateway isolation applied to global localStorage configuration.

Content

No source excerpt is available for this finding.

The documented 'do not migrate or overwrite' option still writes current PRD data during JSONBin configuration validation.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The JSONBin configuration path calls handleTestKVConfig() even when the user selects not to migrate existing data. That test invokes saveRemoteKVData() with the current registry and pins, potentially replacing the destination document or uploading data despite the user's explicit choice; it also dispatches using the currently active provider rather than necessarily JSONBin.

Content

No source excerpt is available for this finding.

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · assets/vendor/vditor/index.min.js (reported line 1)May include surrounding context.

js
=m.e,e.SMILESRender=f.Y,e.markmapRender=h.K,e.flowchartRender=s.D,e.chartRender=o.v,e.abcRender=r.$,e.mindmapRender=v.l,e.plantumlRender=y.M,e.outlineRender=g.N,e.mediaRender=p.l,e.speechRender=_,e.lazyLoadImageRender=d,e.md2html=A,e.preview=N,e.setCodeTheme=D.h,e.setContentTheme=w.H,e}()},913:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i,g:()=>r});var r="3.10.8",i=function(){function e(){}return e.ZWSP="​",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],e.CODE_THEME=["a11y-dark","agate","an-old-hope","androidstudio","arta","atom-one-dark","atom-one-dark-reasonable","base16/3024","base16/apathy","base16/apprentice","base16/ashes","base16/atelier-cave","base16/atelier-dune","base16/atelier-estuary","base16/atelier-forest","base16/atel

Installing PRD assets deletes the project's entire existing assets/vendor directory, including unrelated dependencies.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

When the bundled vendor directory exists, the installer recursively deletes the target project's entire assets/vendor directory before copying its own resources. This exceeds the PRD installer's ownership boundary, destroying unrelated dependencies or custom assets and potentially breaking the application; rerunning installation can trigger the same loss even when HTML injection is skipped.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · README.md (reported line 229)May include surrounding context.

bash
# 变量由部署环境提供。命令中不出现任何值。
curl -X POST "$PRD_GATEWAY/api/prd/$DOC_ID" \
  -H "Authorization: Bearer $PRD_ADMIN_SECRET" \
  -H 'Content-Type: application/json' \
  --data-binary @payload.json

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 416)May include surrounding context.

bash
# 只读备份
curl -sS "$PRD_GATEWAY/api/prd/$DOC_ID" > "archive/d1-$DOC_ID-before-$TS.json"

# 写入(变量由环境提供,命令不出现值)
curl -X POST "$PRD_GATEWAY/api/prd/$DOC_ID" \

The localStorage-only documentation contradicts the cloud persistence path.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

L0005 explicitly states that group definitions and pin assignments are stored only in localStorage and never written to Cloudflare D1. However, L0112–L0133 populate the D1 persistence globals and invoke window.persistData(), with group mutations explicitly calling this path at L0236, L1146, and L1279. Although cloud storage is authorized by the manifest, it directly contradicts this file's documented storage boundary.

Content

No source excerpt is available for this finding.

Group changes are persisted before the promised management-mode confirmation.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Assignment changes call save() and saveGroupsToCloud() immediately, and group creation, editing, and deletion follow similar paths despite the interface promising confirmation before D1 writes. Consequently, declining the later confirmation cannot undo already persisted changes, undermining the advertised approval boundary and potentially affecting shared PRD data.

Content

No source excerpt is available for this finding.

L0424 explicitly requires group headers to display only Chinese page names, without user opt-in or a documented locale-specific justification.

Medium
Category
Output Handling
Confidence
97% confidence
Finding

The comment mandates Chinese-only visible page names and excludes English view identifiers from displayed text. This is an explicit natural-language output constraint, rather than merely the use of Chinese in comments or default interface labels, and it provides no user choice or regional justification.

Content

No source excerpt is available for this finding.

Visitors can change pin assignments through the unguarded group-header drop handler.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The group-header drop path accepts a pin ID from external text drag data and calls assignPin() without checking authorization or management mode. A visitor can therefore change assignments in localStorage and the cloud-facing pin-group global, violating the skill's read-only visitor guarantee; immediate D1 persistence remains blocked by saveGroupsToCloud()'s authorization check.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · assets/prd-pin-tool.js (reported line 1116)May include surrounding context.

js
try {
      const headers = { 'Cache-Control': 'no-cache', 'Pragma': 'no-cache' };
      if (secretKey) headers['X-Master-Key'] = secretKey.trim();
      const resp = await fetch(`https://api.jsonbin.io/v3/b/${binId.trim()}/latest?_t=%24%7BDate.now%28%29%7D%60, { headers });
      if (resp.ok) {
        const json = await resp.json();
        return json.record || json;

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The creation request explicitly sets X-Bin-Private to false while uploading the complete PRD payload, making new records publicly readable to anyone who obtains their identifier. Public visitor access is an intended feature, but automatically choosing public storage for potentially confidential product requirements—also reachable during configuration testing—creates a disclosure risk without a distinct publication decision.

Content

Scanner excerpt · assets/prd-pin-tool.js (reported line 1210)May include surrounding context.

js
const cleanKey = secretKey ? secretKey.trim() : DEFAULT_MASTER_KEY;
    if (!binId) {
      const createResp = await fetch('https://api.jsonbin.io/v3/b', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'X-Master-Key': cleanKey, 'X-Bin-Name': `prd-data-${pageKey}`, 'X-Bin-Private': 'false' },
        body: JSON.stringify(payload)

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This is a duplicate detection of the same public-by-default JSONBin creation request reported by finding-4dd41821b26b4e0791d32fc356e5bfdb. The concern is not use of JSONBin itself, but uploading the complete PRD into a publicly readable record without a separate publication decision.

Content

Scanner excerpt · assets/prd-pin-tool.js (reported line 1210)May include surrounding context.

js
const cleanKey = secretKey ? secretKey.trim() : DEFAULT_MASTER_KEY;
    if (!binId) {
      const createResp = await fetch('https://api.jsonbin.io/v3/b', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'X-Master-Key': cleanKey, 'X-Bin-Name': `prd-data-${pageKey}`, 'X-Bin-Private': 'false' },
        body: JSON.stringify(payload)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · assets/prd-pin-tool.js (reported line 1224)May include surrounding context.

js
}
      return createData;
    }
    const updateResp = await fetch(`https://api.jsonbin.io/v3/b/${binId.trim()}`, {
      method: 'PUT',
      headers: { 'Content-Type': 'application/json', 'X-Master-Key': cleanKey },
      body: JSON.stringify(payload)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · assets/prd-pin-tool.js (reported line 2068)May include surrounding context.

js
if (!token || !owner || !repo) return { success: false, message: '请完整输入 Token 与仓库信息' };
    try {
      const cleanToken = token.trim();
      const resp = await fetch(`https://api.github.com/repos/${owner}/${repo}`, {
        headers: {
          'Authorization': `Bearer ${cleanToken}`,
          'Accept': 'application/vnd.github.v3+json'

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · assets/prd-pin-tool.js (reported line 2088)May include surrounding context.

js
// 尝试读取用户名
      let username = owner;
      try {
        const userResp = await fetch('https://api.github.com/user', {
          headers: {
            'Authorization': `Bearer ${cleanToken}`,
            'Accept': 'application/vnd.github.v3+json'

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · assets/prd-pin-tool.js (reported line 2110)May include surrounding context.

js
// 1. 获取现有文件的 sha
    let sha = null;
    try {
      const getRes = await fetch(`https://api.github.com/repos/${owner}/${repo}/contents/${filePath}?ref=%24%7Bbranch%7D%60, {
        headers: {
          'Authorization': `Bearer ${token.trim()}`,
          'Accept': 'application/vnd.github.v3+json'