T09 · Insecure Skill Coding Practices
- 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: MediumVulnerable 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
--tokenor-tcommand-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
- A user runs the script with a command such as
python scripts/figma_parser.py --file-key FILE_KEY --token SECRET_TOKEN. - The command and token are retained in shell history, captured by local telemetry, or temporarily exposed in process metadata.
- A local user, administrator, monitoring operator, or actor with access to those records retrieves the token.
- The actor submits the token to the Figma API.
- The actor accesses or modifies Figma resources to the extent permitted by the comp ...[truncated 726 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the
--tokencommand-line option for normal operation. - Read the token from a protected environment variable, such as
FIGMA_TOKEN, or request it interactively withgetpass.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.
- Remove the
