Back to skill

Security audit

Software UI Design

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for UI design automation, but it needs Review because it asks users to pass a Figma personal access token on the command line without clear secret-handling safeguards.

Review before installing. Use a least-privilege Figma token, avoid pasting it into command lines where it can enter shell history or process logs, prefer environment or interactive secret entry if you adapt the script, and confirm output paths before writing reports.

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
scripts/figma_parser.py:101
Finding

Figma Personal Access Token Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/figma_parser.py, lines 101–108
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: Medium

Vulnerable Code

python
parser.add_argument('--token', '-t', help='Figma Personal Access Token')
parser.add_argument('--output', '-o', default='figma_report.json', help='输出报告路径')
parser.add_argument('--colors', '-c', action='store_true', help='提取颜色规范')
parser.add_argument('--text', action='store_true', help='提取文字样式')
parser.add_argument('--components', action='store_true', help='提取组件列表')
args = parser.parse_args()
if args.file_key and args.token:
    file_data = get_file(args.file_key, args.token)

Technical Analysis

The script requires the Figma Personal Access Token to be supplied using the --token or -t command-line option. Command-line arguments are not an appropriate channel for reusable credentials because they may be exposed through:

  • Shell command history.
  • Process inspection utilities and operating-system process metadata.
  • Process-monitoring, audit, or observability systems.
  • Terminal logs, automation logs, and copied command examples.

The token is subsequently sent only to the configured official Figma HTTPS endpoint, so no unauthorized remote recipient was identified. The vulnerability concerns local disclosure before or during execution rather than the network transport itself.

Attack Path

  1. A user runs the script with a command such as python scripts/figma_parser.py --file-key FILE_KEY --token SECRET_TOKEN.
  2. The command and token are retained in shell history, captured by local telemetry, or temporarily exposed in process metadata.
  3. A local user, administrator, monitoring operator, or actor with access to those records retrieves the token.
  4. The actor submits the token to the Figma API.
  5. The actor accesses or modifies Figma resources to the extent permitted by the comp ...[truncated 726 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove the --token command-line option for normal operation.
  • Read the token from a protected environment variable, such as FIGMA_TOKEN, or request it interactively with getpass.getpass() when no environment variable is available.
  • Ensure the token is never printed, included in exception messages, or written to report files and application logs.
  • Document the use of short-lived or least-privilege credentials where supported.
  • Restrict access to CI/CD secret stores and prevent secret values from being echoed in build logs.
  • Advise users who previously supplied tokens on the command line to clear relevant history and logs and rotate potentially exposed tokens.
  • Add automated secret-redaction tests and documentation demonstrating a safe invocation pattern.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

The skill explicitly instructs that the user provide a Figma Personal Access Token, which is a sensitive credential, but it does not define secure handling, storage, scope minimization, or redaction requirements. In an agent setting, this can lead to token exposure in prompts, logs, generated artifacts, or misuse of the credential for broader API access than the user expects.

Content

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

md
4. **输出交付**:文档 / 资产包 / 报告

## 注意事项
- Figma 需要用户提供 Personal Access Token
- Sketch/XD 文件较大,建议压缩或提供具体画板范围
- 切图优先导出 SVG 再转 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 · scripts/figma_parser.py (reported line 99)May include surrounding context.

python
if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Figma 设计解析')
    parser.add_argument('--file-key', '-f', help='Figma 文件 Key')
    parser.add_argument('--token', '-t', help='Figma Personal Access Token')
    parser.add_argument('--output', '-o', default='figma_report.json', help='输出报告路径')
    parser.add_argument('--colors', '-c', action='store_true', help='提取颜色规范')
    parser.add_argument('--text', action='store_true', help='提取文字样式')

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill describes capabilities that imply file read/write and network access, including parsing local design files, exporting assets, and calling the Figma API, but it declares no explicit tool scope or permission boundaries. Without least-privilege constraints, an agent may invoke broader tools than necessary and handle local files or remote resources in ways the user did not clearly authorize.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger description is very broad, covering parsing, export, validation, asset handling, and design-to-code conversion, without clear activation criteria or user-consent boundaries. This increases the risk that the skill is invoked in situations where sensitive local files, remote design links, or export operations are processed more aggressively than the user intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The primary description and headings are written entirely in Chinese, which implies a fixed language/locale for the skill experience without stating that users may choose another language. Under the policy, forcing a specific language without opt-in or documented regional justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language strings in the docstring, CLI description, help text, and status/error messages are all Chinese, which imposes a fixed language on users. There is no opt-in, alternate locale, or documentation indicating that this skill is intentionally limited to Chinese-speaking users.

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 · scripts/figma_parser.py (reported line 8)May include surrounding context.

python
import requests
import os

FIGMA_API = "https://api.figma.com/v1"


def get_file(file_key, token):

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code performs outbound HTTP requests to the Figma API using a personal access token and a file key, which transmits potentially sensitive project metadata and credentials context off the local system. Although the script has a module docstring, it does not clearly warn the user that it will contact an external service and send supplied identifiers/authentication data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring and all user-facing CLI/help text in this file are written only in Chinese, indicating a fixed language choice. The policy forbids forcing a specific language or locale unless the user is given a choice or the constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.