Back to skill

Security audit

Figma Mobile

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent, but it tells the agent to collect and save a Figma access token in an unsafe way.

Review before installing. Do not paste a Figma access token into chat. Configure FIGMA_TOKEN yourself through a trusted environment or secret manager, keep any .env file out of version control, and rotate any token that was pasted into a conversation or stored insecurely.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:176
Finding

Insecure Collection and Plaintext Storage of Figma Personal Access Tokens

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (39)

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 · README.md (reported line 54)May include surrounding context.

md
## 配置

1. 获取 Figma Personal Access Token:  
   Figma → 头像 → Settings → Security → Personal Access Tokens,新建 token(一般以 `figd_` 开头)。

2. 设置环境变量,或把下面一行写入项目根目录 `.env`(脚本会自动读取):

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 · README.md (reported line 151)May include surrounding context.

md
## 配置

1. 获取 Figma Personal Access Token:  
   Figma → 头像 → Settings → Security → Personal Access Tokens,新建 token(一般以 `figd_` 开头)。

2. 设置环境变量,或把下面一行写入项目根目录 `.env`(脚本会自动读取):

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 135)May include surrounding context.

md
│       ├── figma-fetch.js        # Figma API:拉取 / 对比 / SVG
│       ├── project-scan.js       # 工程资源轻量扫描
│       ├── feedback-analyze.js   # 反馈日志分析
│       └── load-env.js           # .env 加载
├── references/
│   ├── figma-interpretation.md
│   ├── figma-scan-usage.md

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个“Figma 设计稿转移动端 UI 代码生成器”。但实际代码仅实现了对 feedback-log.md 的离线解析与统计:从 markdown 分段中提取平台、问题和规则候选,统计关键词并输出 JSON 总结。代码中没有任何网络请求、Figma API 交互、设计树/token 提取、澄清逻辑或代码生成逻辑。其主要目的与声明完全不同,因此属于明显的不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description centers on converting Figma designs into production-ready mobile UI code. This code chunk does not perform any code generation for Android or iOS frameworks. Its actual primary purpose is data retrieval and preprocessing: it fetches Figma node documents, simplifies their JSON structure, compares two trees, and exports SVG URLs. Using the Figma API is consistent with the description, but the core promised behavior—transforming designs into UI code—is absent in this chunk. Additionally, the compare mode and SVG export are extra capabilities not mentioned in the declared purpose. Therefore the description does not accurately represent what this code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code chunk does not implement Figma design conversion, design tree extraction, token processing, clarification prompts, or mobile UI code generation. Its sole purpose is a generic utility to read a local .env file from disk and populate process.env. While loading environment variables could be a supporting utility in a larger project, this chunk by itself performs a materially different function from the declared skill behavior and accesses local filesystem resources not mentioned in the description. Therefore this code chunk does not accurately represent the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description centers on Figma-to-code generation: ingesting a Figma link, querying the Figma REST API, extracting design structure/tokens, and producing mobile UI code. The supplied code instead performs repository/project introspection on local filesystem paths. Its primary function is to scan existing Android/iOS project resources and serialize them into a JSON report. This is materially different from the declared purpose, and the key promised capabilities—handling Figma links, calling Figma APIs, extracting design trees/tokens, and generating Compose/XML/SwiftUI/UIKit code—are absent. Therefore this is a clear description-behavior mismatch.

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 · README.md (reported line 55)May include surrounding context.

md
## 环境要求

- 环境变量 `FIGMA_TOKEN`(Figma → 头像 → Settings → Security → Personal Access Tokens)
- **Node.js 18+**(内置 `fetch`;脚本为纯 JavaScript,**无需** `npm install`)
- 脚本入口:在 `scripts/` 下执行 `node src/figma-fetch.js`,或 `npm run figma-fetch --`(`package.json` 仅用于声明 `type: module` 与 npm 脚本快捷方式,无第三方依赖)

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 · SKILL.md (reported line 26)May include surrounding context.

md
## 环境要求

- 环境变量 `FIGMA_TOKEN`(Figma → 头像 → Settings → Security → Personal Access Tokens)
- **Node.js 18+**(内置 `fetch`;脚本为纯 JavaScript,**无需** `npm install`)
- 脚本入口:在 `scripts/` 下执行 `node src/figma-fetch.js`,或 `npm run figma-fetch --`(`package.json` 仅用于声明 `type: module` 与 npm 脚本快捷方式,无第三方依赖)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly instructs the agent to ask the user to paste a Figma personal access token into chat and then write it into a local .env file. This is dangerous because it normalizes credential collection through an unsafe channel, increases exposure in chat logs, and creates persistent local secret storage without strong justification or controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The instructions collect and persist a Figma personal access token without presenting a clear security warning, retention notice, or safer alternative. Users may unknowingly disclose sensitive credentials into conversation history and local files, creating avoidable account and project exposure.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This is a direct natural-language instruction to solicit a secret from the user and retain it locally. In a skill that already has env and file access, that materially increases the chance of credential theft, accidental logging, unauthorized reuse, or later disclosure through filesystem access or debugging output.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

This finding points to the instruction to obtain a Figma personal access token from the user. Soliciting credentials directly in conversation is a high-risk anti-pattern because chat transcripts may be retained, exposed to operators, or reused beyond the immediate task.

Content

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

md
## 异常处理

- **`FIGMA_TOKEN` 未设置**(脚本打印 `FIGMA_TOKEN_NOT_SET`)→ **不要**让用户自行敲复杂命令。应:
  1. 说明需要 Figma Personal Access Token
  2. 指引:Figma → 头像 → Settings → Security → Personal Access Tokens
  3. 请用户在对话中粘贴 token(通常以 `figd_` 开头)
  4. 将 token 写入项目根目录 `.env`:`FIGMA_TOKEN=figd_xxx`(脚本会自动读取 `.env`)

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

The skill not only asks for the access token but also directs writing it into a local .env file. That creates persistent credential material on disk that may be accidentally committed, read by other tools, or exposed through later file operations, making the skill context substantially more dangerous.

Content

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

md
- **`FIGMA_TOKEN` 未设置**(脚本打印 `FIGMA_TOKEN_NOT_SET`)→ **不要**让用户自行敲复杂命令。应:
  1. 说明需要 Figma Personal Access Token
  2. 指引:Figma → 头像 → Settings → Security → Personal Access Tokens
  3. 请用户在对话中粘贴 token(通常以 `figd_` 开头)
  4. 将 token 写入项目根目录 `.env`:`FIGMA_TOKEN=figd_xxx`(脚本会自动读取 `.env`)
  5. 再次执行 `node src/figma-fetch.js` 或 `npm run figma-fetch --`

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/platform-xml.md (reported line 30)May include surrounding context.

  • 注意:强信号非绝对;若明显是静态页上装饰性「标签」,应调整;不确定则 追问。
xml
<!-- 标准 TabLayout + ViewPager2 -->
<com.google.android.material.tabs.TabLayout
    android:id="@+id/tabLayout"
    android:layout_width="0dp"

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/platform-xml.md (reported line 71)May include surrounding context.

android:src="@drawable/placeholder" android:scaleType="centerInside" android:contentDescription="返回" />

text

### 图标 + 文字按钮

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/platform-xml.md (reported line 71)May include surrounding context.

android:src="@drawable/placeholder" android:scaleType="centerInside" android:contentDescription="返回" />

text

### 图标 + 文字按钮

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/platform-xml.md (reported line 141)May include surrounding context.

md
<item android:drawable="@drawable/bg_gender_card_unselected" />
</selector>

<!-- drawable/ic_check_selector.xml(可用透明度控制显隐) -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_selected="true" android:drawable="@drawable/ic_check_selected" />
    <item android:drawable="@android:color/transparent" />

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/platform-xml.md (reported line 141)May include surrounding context.

md
<item android:drawable="@drawable/bg_gender_card_unselected" />
</selector>

<!-- drawable/ic_check_selector.xml(可用透明度控制显隐) -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_selected="true" android:drawable="@drawable/ic_check_selected" />
    <item android:drawable="@android:color/transparent" />

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/src/load-env.js (reported line 6)May include surrounding context.

js
/** 从项目根 `.env` 加载 KEY=value(不覆盖已有环境变量) */
export function loadDotEnv(cwd = process.cwd(), envPath) {
  const p = envPath ?? resolve(cwd, ".env");
  if (!existsSync(p)) return;
  const raw = readFileSync(p, "utf8");
  for (const line of raw.split("\n")) {

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README explicitly encourages storing a Figma personal access token in a project-root .env file that is auto-loaded, but gives no warning about keeping that file out of version control, rotating leaked tokens, or minimizing token scope. This increases the chance of accidental credential exposure through commits, logs, support bundles, or agent access to the workspace.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill declares access to environment variables and performs network-capable operations, but it does not define an explicit tool or permission scope. That weakens least-privilege controls and makes it harder to constrain what the skill may access at runtime, especially given it also handles credentials and external URLs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The line states that the body text is in Chinese, establishing a language constraint for the skill's instructions. Because there is no indication that the user can choose another language or opt in to Chinese, this is a natural-language locale policy issue under the stated rule.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file explicitly encourages storing user corrections along with generated code snippets, but it provides no guidance to avoid copying sensitive Figma content, proprietary UI code, internal URLs, tokens, or other confidential data into the log. In this skill context, that omission is meaningful because design-to-code workflows often handle private product designs and generated code derived from non-public assets, making accidental retention and later reuse of sensitive information more likely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The title and the entire instruction set are written as mandatory Chinese-language rules for code generation, with no indication that the user may choose another language or locale. This creates a natural-language locale policy issue because it implicitly enforces Chinese output/instructions without opt-in or justification.

Content

No source excerpt is available for this finding.