Back to skill

Security audit

figma-design-analyzer

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to do what it says: it uses a user-provided Figma token to inspect/export Figma data and compare it with local implementation files, with some install and secret-handling cautions.

Install only from a verified package or repository, review dependencies or use a lockfile, and treat FIGMA_ACCESS_TOKEN as a sensitive secret. Use a token with the minimum needed access, keep .env out of version control, rotate the token if exposed, and be aware that file metadata, comments, versions, design structure, and exported screenshots may be retrieved from Figma and stored locally.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (1)

T08 · Insecure Dependencies

Warning
Location
README.md:47
Finding

Unpinned and Unverifiable Third-Party Installation Sources

Content
View full analysis

Vulnerability Details

File Location: README.md:47, README.md:53, package.json:23-30
Vulnerability Type: Supply-chain risk through unpinned packages and unverifiable installation sources
Risk Level: Medium

Vulnerable Code

README.md:47:

bash
npx skills add yourusername/agent-skills/figma-design-analyzer

README.md:53:

bash
git clone https://github.com/yourusername/agent-skills.git

package.json:23-30:

json
"dependencies": {
  "axios": "^1.6.0",
  "commander": "^11.1.0",
  "chalk": "^4.1.2",
  "dotenv": "^16.3.1",
  "jsdom": "^22.1.0",
  "sharp": "^0.33.0"
},

Technical Analysis

The documented npx installation command does not specify an immutable package version or revision. It may therefore retrieve and execute whichever package version the registry resolves at installation time. The repository URL also uses a placeholder account, preventing users from reliably verifying that they are cloning the intended official source.

Runtime dependencies use caret version ranges, while the audited project contains no lockfile. Consequently, separate installations can resolve different dependency versions. This weakens reproducibility and allows the effective dependency code to change after the Skill itself has been reviewed.

This condition does not establish that any current dependency is malicious. It creates a supply-chain exposure in which registry compromise, package-account takeover, namespace confusion, or a malicious future release could introduce executable code without corresponding changes to this repository.

Attack Path

  1. A user follows the README and executes the unpinned npx installation command or runs npm install.
  2. The package registry resolves the current package and dependency versions rather than an audited immutable set.
  3. An attacker who controls or compromises one of the resolved packages publishes a malicious comp ...[truncated 1074 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace placeholder package and repository identifiers with the verified official project namespace and HTTPS repository URL.
  2. Pin the documented npx installation to a reviewed exact version or immutable revision.
  3. Pin runtime dependencies to exact versions rather than mutable caret ranges where operationally practical.
  4. Generate, review, and commit package-lock.json so the complete dependency graph is reproducible.
  5. Use npm ci in CI/CD and documented production installation procedures.
  6. Review package lifecycle scripts before installation and use --ignore-scripts where lifecycle execution is unnecessary.
  7. Use dependency integrity verification, automated vulnerability scanning, and controlled dependency-update review.
  8. Run installation and execution with a least-privileged user and avoid exposing unrelated credentials to the process.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (51)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

项目包含 .env.example 文件,复制为 .env 并填写您的令牌即可:

bash
cp .env.example .env
# 编辑 .env 文件,将 FIGMA_ACCESS_TOKEN 替换为您的实际令牌

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

项目包含 .env.example 文件,复制为 .env 并填写您的令牌即可:

bash
cp .env.example .env
# 编辑 .env 文件,将 FIGMA_ACCESS_TOKEN 替换为您的实际令牌

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

项目包含 .env.example 文件,复制为 .env 并填写您的令牌即可:

bash
cp .env.example .env
# 编辑 .env 文件,将 FIGMA_ACCESS_TOKEN 替换为您的实际令牌

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

描述与代码存在实质性不一致。代码的主要职责是“比对模块”,重点在于解析本地实现文件并和已提取的 Figma 设计系统进行比较,再输出报告;它并不直接实现 Figma 文件分析全流程,也没有实现声明中提到的截图/设计资源导出。虽然描述提到了‘与实际实现进行比对验证’,这一点与代码相符,但其余关键能力,尤其是 Figma 提取与截图导出,在该代码块中缺失。同时,代码还包含对本地 CSS/通用文件的读取、解析及 HTML 报告生成等更具体的行为,说明该代码块实际范围更偏向实现比对与报告,而非完整的 Figma 设计文件处理技能。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

代码的核心确实是在处理 Figma 文件并提取设计系统相关数据,这与声明中的大部分内容一致。但声明还包含两个明确能力:一是导出截图,二是与实际实现进行比对验证。所给代码仅调用 Figma 文件接口获取结构化设计数据,并做提取、去重、排序和简单分析;没有调用图像导出相关接口,没有生成或下载截图,也没有读取任何实现端资源(如前端代码、DOM、样式文件或截图)来进行比对验证。因此描述比实际行为更宽,存在能力层面的描述不实/未覆盖,属于 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个较完整的 Figma 设计分析与验证工具,包含设计规范提取、截图导出和实现比对等能力。但该代码片段仅实现了较底层的文件信息访问:解析文件 ID、读取文件元数据、页面结构、组件/样式键列表、版本记录、评论、节点详情与搜索。虽然这与“分析 Figma 文件”部分相关,但没有看到对颜色、字体、间距等设计系统数据的具体提取逻辑,也没有截图导出或实现比对功能。因此代码行为只覆盖了声明中的一小部分,并包含额外的协作/版本信息抓取,整体上与声明的主要用途存在明显不一致。

Content

No source excerpt is available for this finding.

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 · references/figma-api.md (reported line 16)May include surrounding context.

md
获取个人访问令牌:
1. 登录Figma
2. 进入 Settings → Account
3. 在 Personal access tokens 部分创建新令牌

## 核心API端点

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
if (!token) {
    console.error(chalk.red('错误: 未设置FIGMA_ACCESS_TOKEN环境变量'));
    console.error(chalk.yellow('请选择以下方式之一设置令牌:'));
    console.error(chalk.yellow('1. 使用.env文件: cp .env.example .env 并填写您的令牌'));
    console.error(chalk.yellow('2. 直接设置环境变量: export FIGMA_ACCESS_TOKEN=your_token'));
    console.error(chalk.yellow('3. 临时设置: FIGMA_ACCESS_TOKEN=your_token node scripts/figma-cli.js ...'));
    process.exit(1);

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
if (!token) {
    console.error(chalk.red('错误: 未设置FIGMA_ACCESS_TOKEN环境变量'));
    console.error(chalk.yellow('请选择以下方式之一设置令牌:'));
    console.error(chalk.yellow('1. 使用.env文件: cp .env.example .env 并填写您的令牌'));
    console.error(chalk.yellow('2. 直接设置环境变量: export FIGMA_ACCESS_TOKEN=your_token'));
    console.error(chalk.yellow('3. 临时设置: FIGMA_ACCESS_TOKEN=your_token node scripts/figma-cli.js ...'));
    process.exit(1);

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
if (!token) {
    console.error(chalk.red('错误: 未设置FIGMA_ACCESS_TOKEN环境变量'));
    console.error(chalk.yellow('请选择以下方式之一设置令牌:'));
    console.error(chalk.yellow('1. 使用.env文件: cp .env.example .env 并填写您的令牌'));
    console.error(chalk.yellow('2. 直接设置环境变量: export FIGMA_ACCESS_TOKEN=your_token'));
    console.error(chalk.yellow('3. 临时设置: FIGMA_ACCESS_TOKEN=your_token node scripts/figma-cli.js ...'));
    process.exit(1);

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/figma-cli.js (reported line 26)May include surrounding context.

js
if (!token) {
    console.error(chalk.red('错误: 未设置FIGMA_ACCESS_TOKEN环境变量'));
    console.error(chalk.yellow('请选择以下方式之一设置令牌:'));
    console.error(chalk.yellow('1. 使用.env文件: cp .env.example .env 并填写您的令牌'));
    console.error(chalk.yellow('2. 直接设置环境变量: export FIGMA_ACCESS_TOKEN=your_token'));
    console.error(chalk.yellow('3. 临时设置: FIGMA_ACCESS_TOKEN=your_token node scripts/figma-cli.js ...'));
    process.exit(1);

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/modules/design-comparator.js (reported line 138)May include surrounding context.

js
}
    }

    return rules;

  } catch (error) {
    console.error('解析CSS文件失败:', error.message);

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill instructs users to provide a personal Figma access token and analyze/export design content via API, but it does not clearly warn that credentials will be used for outbound API requests or that potentially sensitive design data may be transmitted to Figma services. In a design-analysis skill, this increases the chance of unsafe handling of production secrets or confidential design assets by users who may not realize the exposure.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
82% confidence
Finding

The README recommends installing and running a tool via npx skills without pinning an exact package version or integrity source. That creates a supply-chain risk: users may fetch whatever package is current at execution time, and a compromised or typosquatted package could run arbitrary code in the user's environment.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

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.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

L03 将触发条件描述为“当用户需要处理Figma设计文件、提取设计规范、导出设计资源或验证设计实现时使用此技能”,范围较大且没有给出明确触发短语、边界或排除条件。这样的表述容易在一般性的设计讨论或实现验证请求中被过度匹配,导致非预期调用。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs users to supply a Figma access token and process design files, but it provides no warning about secret handling, remote transmission, exported artifacts, or sensitivity of design data. In a design-analysis context, that omission is materially dangerous because users may expose production designs, comments, or proprietary assets without understanding where data goes or what gets saved.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document instructs users to use a personal access token for Figma API authentication but does not include any guidance on secure handling, such as avoiding hardcoding, logging, committing tokens to source control, or storing them insecurely. In a skill meant to automate API access, that omission materially increases the chance that operators will expose long-lived credentials during implementation or troubleshooting.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code forces a specific language for its docstring, help text, and error messages, which is a natural-language locale policy concern under the stated rules. There is no indication that the tool is region-specific or that users can opt into another language.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

generateHTMLReport(report) reads report.figma_design_summary and report.implementation_summary, but the report object built in compareWithImplementation does not contain those fields. This mismatch can cause a runtime exception when report generation accesses undefined properties, enabling a denial-of-service condition for any workflow that depends on HTML report output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code makes multiple outbound requests to the Figma API to retrieve file metadata, version history, and comments, which can expose user or workspace design data to an external service. Although the module has internal comments, it provides no confirmation prompt or user-facing warning indicating that potentially sensitive file and collaboration information will be fetched over the network.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language documentation and runtime messages exclusively in Chinese, starting with the module header and continuing throughout logs and errors. Per the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

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 · references/figma-api.md (reported line 192)May include surrounding context.

md
// 1. 获取截图URL
    const imageResponse = await axios.get(
      `https://api.figma.com/v1/images/${fileId}?ids=${nodeId}&scale=${scale}&format=${format}`,
      { headers }
    );

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 · scripts/modules/design-extractor.js (reported line 200)May include surrounding context.

js
// 1. 获取截图URL
    const imageResponse = await axios.get(
      `https://api.figma.com/v1/images/${fileId}?ids=${nodeId}&scale=${scale}&format=${format}`,
      { headers }
    );

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 · scripts/modules/file-info.js (reported line 48)May include surrounding context.

js
// 1. 获取截图URL
    const imageResponse = await axios.get(
      `https://api.figma.com/v1/images/${fileId}?ids=${nodeId}&scale=${scale}&format=${format}`,
      { headers }
    );