Back to skill

Security audit

Pm Proto Prd Pin

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent PRD annotation tool, but its default cloud sync, hardcoded service credentials/endpoints, and browser-stored tokens need human review before installation.

Review and remove the hardcoded Supabase/JSONBin defaults before using this with private specifications. Use least-privilege tokens, avoid storing PATs in browser storage when possible, confirm repository visibility before GitHub sync, and run the injector only on a backed-up project because it can overwrite vendor assets.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (15)

Context-Inappropriate Capability

Medium
Confidence
98% confidence
Finding
The file includes microphone capture, WAV generation, and upload integration via getUserMedia plus automatic handoff to the upload pipeline. In a skill environment, this creates a clear privacy and data-exfiltration risk because captured audio can be transmitted to a configured upload endpoint with minimal contextual justification.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The file includes microphone capture, WAV generation, and upload integration via getUserMedia plus automatic handoff to the upload pipeline. In a skill environment, this creates a clear privacy and data-exfiltration risk because captured audio can be transmitted to a configured upload endpoint with minimal contextual justification.

Missing User Warnings

Low
Confidence
83% confidence
Finding
The README explicitly states that any new browser or visitor will automatically fetch the latest PRD data from a cloud bin with no configuration, but it does not pair this behavior with a clear privacy/data-transfer warning or consent notice. This can cause users to unknowingly contact a third-party service and expose usage metadata or pull potentially sensitive specification content across browsers.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
This code stores sensitive credentials such as GitHub tokens, Supabase keys, and JSONBin master keys in localStorage/sessionStorage, which are accessible to any script running in the same origin. If the page or any included dependency is compromised via XSS or malicious third-party script, those credentials can be stolen and used to write to GitHub, Supabase, or remote KV stores.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The save path sends PRD content to third-party services like Supabase and JSONBin, including page identifiers and full requirement data, without a clear just-in-time disclosure or consent flow at execution time. In a documentation tool, this can expose potentially sensitive internal product specifications to external infrastructure unexpectedly.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
This code serializes PRD content and pushes it directly to a GitHub repository via the GitHub API, which is an external transmission of potentially confidential design and business information. Without an execution-time warning and with browser-stored tokens, users may unintentionally publish internal content or overwrite repository files.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
Microphone recording can be started from the toolbar and later uploaded through the generic upload path, but the inline UX does not clearly disclose that recorded audio may be transmitted off-device. Even with browser permission prompts, users may not understand the data flow or persistence implications, creating a meaningful privacy risk.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script unconditionally deletes the destination vendor directory with shutil.rmtree() if it already exists, without prompting the user, creating a backup, or validating that the target path is safe and expected. Because the target directory is derived from a user-supplied path, running this against the wrong project or an unexpected directory can destroy existing assets and cause data loss or service disruption.

External Transmission

Medium
Category
Data Exfiltration
Content
### 1. 🔑 方案 1:Serverless 云端 KV 存储打点(JSONBin.io / 自定义 KV)—— 【强烈推荐 / 最快捷】
- **核心实现原理**:
  - 采用 RESTful KV 读写分离架构:
    - **公开只读**:`GET https://api.jsonbin.io/v3/b/{binId}/latest?_t=${Date.now()}`,访客免密秒级拉取最新规约(添加抗缓存时间戳);
    - **私密写入**:`PUT https://api.jsonbin.io/v3/b/{binId}`,Header 携带 `X-Master-Key` 鉴权更新;
- **核心优势与快捷性**:
  - **秒级极速响应 (200~300ms)**:修改后瞬间保存生效,跨电脑、跨浏览器、移动端打开即时同步;
Confidence
86% confidence
Finding
This documents unauthenticated public reads from JSONBin to load specification data for visitors. If the stored PRD content is sensitive, exposing it through a public endpoint allows unintended external transmission and broad disclosure to anyone with access to the prototype or endpoint.

External Transmission

Medium
Category
Data Exfiltration
Content
- **核心实现原理**:
  - 采用 RESTful KV 读写分离架构:
    - **公开只读**:`GET https://api.jsonbin.io/v3/b/{binId}/latest?_t=${Date.now()}`,访客免密秒级拉取最新规约(添加抗缓存时间戳);
    - **私密写入**:`PUT https://api.jsonbin.io/v3/b/{binId}`,Header 携带 `X-Master-Key` 鉴权更新;
- **核心优势与快捷性**:
  - **秒级极速响应 (200~300ms)**:修改后瞬间保存生效,跨电脑、跨浏览器、移动端打开即时同步;
  - **100% 零服务器运维**:无需购买任何云主机或配置数据库,开箱即用;
Confidence
88% confidence
Finding
The README describes writing PRD data to a third-party JSONBin endpoint using an X-Master-Key header. Sending live specification data and authentication material to an external service increases the risk of data leakage, key misuse, and accidental exposure if client-side code or configuration embeds the bin identifier and write workflow insecurely.

External Transmission

Medium
Category
Data Exfiltration
Content
### 2. ☁️ 方案 2:GitHub Contents API 推送打点(Git Commit 模式)
- **核心实现原理**:
  - 使用 GitHub Fine-Grained Personal Access Token (PAT);
  - 调用 `PUT https://api.github.com/repos/{owner}/{repo}/contents/{filePath}`,将打点数据以 Base64 编码自动生成正式 Git Commit 提交入库;
- **特性与局限性说明 (Trade-offs)**:
  - **版本审计追踪优势**:每一次修改在 GitHub 仓库中均有完整的提交者信息与版本 Diff 历史,便于合规审计;
  - **推送相对较慢 (1~3 秒)**:由于涉及 GitHub API 的 Tree 递归计算与 Commit 链打包,写入耗时相对较长;且若依赖 GitHub Pages 构建重新部署,公网生效存在几分钟流水线延迟。
Confidence
85% confidence
Finding
This documents pushing PRD data to GitHub via the Contents API, which transmits potentially sensitive specifications to an external platform and may make them persistent in repository history. If used with misconfigured repositories or broad tokens, disclosure can be long-lived and difficult to fully remediate.

External Transmission

Medium
Category
Data Exfiltration
Content
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)
Confidence
88% confidence
Finding
The code performs a network POST to JSONBin containing the full PRD payload and an authorization key. While this is part of advertised sync functionality, it is still an external data transmission path that can leak sensitive internal documentation if enabled unknowingly or configured insecurely.

External Transmission

Medium
Category
Data Exfiltration
Content
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)
Confidence
88% confidence
Finding
The code performs a network POST to JSONBin containing the full PRD payload and an authorization key. While this is part of advertised sync functionality, it is still an external data transmission path that can leak sensitive internal documentation if enabled unknowingly or configured insecurely.

External Transmission

Medium
Category
Data Exfiltration
Content
}
      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)
Confidence
87% confidence
Finding
The code performs a PUT to JSONBin with the full PRD payload and master key, updating a third-party-hosted record. In this skill context, PRD content may include internal workflows, rules, or unreleased product details, so unintended external persistence carries confidentiality risk.

External Transmission

Medium
Category
Data Exfiltration
Content
const base64Content = btoa(binary);

    // 3. 直接通过 PUT 请求向 GitHub 提交 Commit
    const putRes = await fetch(`https://api.github.com/repos/${owner}/${repo}/contents/${filePath}`, {
      method: 'PUT',
      headers: {
        'Authorization': `Bearer ${token.trim()}`,
Confidence
92% confidence
Finding
This PUT sends repository content to GitHub using a bearer token, directly writing serialized PRD data to a remote repository. In the context of an embedded browser-side tool, this is security-relevant because sensitive specs can be uploaded externally and repository contents can be modified if the token is stolen or misused.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
assets/prd-pin-tool.js:886