Back to skill

Security audit

Figma Mobile Cn

Security checks for vulnerabilities and agentic risk

Overview

Review recommended: the skill is mostly a coherent Figma-to-mobile-code helper, but it tells the agent to collect and store a Figma access token insecurely.

Use this skill only if you configure FIGMA_TOKEN outside the chat through your shell, platform secret settings, or another trusted secret mechanism. Do not paste Figma tokens into conversation; avoid plaintext .env storage when possible, ensure .env is gitignored if used, and rotate any token that was pasted, committed, logged, or shared.

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

Unsafe Collection and Plaintext Persistence of a Figma Access Token

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

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

There is a clear material mismatch between the declared description and the supplied code. The description promises a Figma design conversion workflow for generating mobile UI code, but the code only analyzes a local markdown feedback log and summarizes issues by platform and keyword. It does not interact with Figma, does not generate any UI code, and its primary purpose is unrelated feedback analysis. This is not a supporting implementation detail; it is an entirely different function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description centers on transforming Figma designs into mobile UI implementation code. However, this code chunk only fetches and preprocesses Figma data: it parses Figma links, calls /files/.../nodes and /images endpoints, simplifies node JSON, compares two simplified trees, and prints JSON output. There is no logic for producing Android or iOS source code, no template/rendering layer, and no clarification or code emission behavior. The extra compare and SVG export features are also not mentioned in the declared purpose. While using the Figma REST API is consistent with part of the description, the primary behavior of this chunk is materially different from the claimed end-user function, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code chunk’s behavior is materially unrelated to the declared primary purpose. The description says the skill should process Figma links and generate mobile UI code, but the implementation shown is a generic environment-loader utility. While loading environment variables could be a supporting helper in a larger Figma-related project, this chunk by itself does not implement the declared functionality and instead accesses local filesystem resources that are not mentioned in the description or permissions. Therefore this is a description/behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个“Figma 设计稿转移动端 UI 代码生成器”。但代码实际是 project-scan.js 命令行工具:接收本地项目路径,识别 Android 或 iOS 工程;对 Android 解析 res/values 下的 colors/strings/dimens 和 drawable 文件名,构建索引后输出 JSON;对 iOS 仅检查是否存在 .xcodeproj 并返回占位说明。整个代码没有网络请求、没有 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 · 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 the conversation and then persist it to a local .env file. This is dangerous because secrets entered into chat may be logged, retained, or exposed to other tools, and writing them to disk broadens exposure beyond the immediate task.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill socially engineers the user to disclose a sensitive credential in natural-language conversation, which is exactly the kind of pattern that leads to secret compromise in agent systems. Because the skill's purpose is UI code generation, collecting raw credentials in chat is broader than necessary and especially risky in environments with conversation retention or tool chaining.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

This instruction directly tells the agent to obtain a personal access token from the user. In a conversational agent context, requesting secrets in-band is dangerous because the credential may be stored in transcripts, leaked to plugins/tools, or reused beyond the user's expectation.

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

This step compounds the prior issue by instructing persistence of the token in a project-local .env file after disclosure in chat. That creates both conversational exposure and on-disk exposure, increasing the risk of accidental source control commits, local compromise, or reuse by unrelated processes.

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" />

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a skill that ingests Figma links, calls the Figma REST API, and generates Android/iOS UI code. This file instead implements a standalone local CLI that parses a markdown feedback log and outputs issue/rule summaries, which is unrelated to extracting Figma design trees or producing mobile UI code.

Content

No source excerpt is available for this finding.

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
94% confidence
Finding

The README tells users to place a Figma personal access token in an environment variable or a project-root .env file, but it does not warn that the token is sensitive, should not be committed, and should be excluded from logs and generated artifacts. This creates a realistic secret-exposure risk because users commonly commit .env files or leave them in shared project directories, allowing unauthorized access to Figma resources tied to the token.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill declares access to environment variables and implies network use via Figma API calls, but it does not constrain tool scope with explicit permissions or allowed-tools. In an agent setting, missing scope boundaries can let the skill invoke broader capabilities than necessary, increasing the blast radius if the workflow is abused or the implementation drifts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow directs storage of a Figma token in a local .env file without warning users about chat logging, accidental commit risk, local file exposure, or secret reuse. That omission materially increases the chance of credential leakage, especially in developer workspaces where .env files may be copied, backed up, or committed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The instructional content and headings are presented in Chinese, while examples and command details are mixed-language, with no indication that language choice is optional or that the skill is intentionally region-specific. Under the policy criteria, this can constitute a language/locale constraint without explicit user opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file presents all guidance, examples, and instructions exclusively in Chinese. Under the policy rule for language/locale, forcing a specific language without user opt-in can be a natural-language policy violation when no alternative or justification is provided.

Content

No source excerpt is available for this finding.