Back to skill

Security audit

Templates

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for reading Figma design context, but it needs review because issue metadata can steer artifact writes and deletion outside the intended output folder.

Install only if you trust the Multica issue JSON source and are comfortable with the skill reading Figma credentials, contacting Figma, scanning up to 5000 files in the repair repo for Code Connect hints, writing .multica artifacts, and updating .git/info/exclude. The path handling should be fixed before use with untrusted issue metadata.

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/lib/figma-artifact-writer.mjs:18
Finding

Path Traversal Through Untrusted Issue Identifier Allows Writes Outside the Artifact Root

Content
View full analysis

Vulnerability Details

File Location: scripts/lib/figma-artifact-writer.mjs, lines 18-20 and 376-378
Vulnerability Type: Path traversal and insufficient output-path containment
Risk Level: Medium

Vulnerable Code

js
function issueRunName(issue) {
  return issue?.identifier || issue?.id || `manual-${new Date().toISOString().replace(/[:.]/g, '-')}`;
}

The resulting untrusted value is later used directly as a path component:

js
const runName = issueRunName(issue);
const runDir = path.join(artifactRoot, runName);
await fs.mkdir(runDir, { recursive: true });

Files and directories are subsequently created beneath this path:

js
await writeUrlArtifacts(runDir, urlResult);
js
await writeJson(path.join(runDir, 'manifest.json'), manifest);
await writeText(path.join(runDir, 'summary.md'), buildSummary({ urlResults: normalizedResults, manifest, emptyReason }));

A recursively destructive operation can also occur beneath the derived path:

js
const urlDir = path.join(runDir, urlResult.artifactDir);
const artifactBytes = await directorySizeBytes(urlDir);
if (artifactBytes > maxArtifactBytesPerUrl) {
  await fs.rm(urlDir, { recursive: true, force: true });
  normalizedResults[index] = artifactBudgetFailure(urlResult, Math.floor(maxArtifactBytesPerUrl), artifactBytes);
}

Technical Analysis

The run directory name is derived from issue.identifier or issue.id, which originates in the supplied issue JSON. The value is neither restricted to a safe filename grammar nor checked for path separators, absolute paths, . segments, or .. traversal segments.

path.join() normalizes traversal segments but does not enforce containment beneath artifactRoot. For example, if artifactRoot is /repo/.multica/figma-context and the issue identifier is ../../target, the resulting path resolves outside the configured artifact directory.

The workflow then writes predictable files such as manifest.json, summary.md, a ...[truncated 2147 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not use raw issue metadata as a directory name. Convert it to a safe slug with a strict allowlist, such as ASCII letters, digits, underscores, periods, and hyphens. Explicitly reject empty values, . and ...
js
function safeRunName(issue) {
  const raw = String(
    issue?.identifier ||
    issue?.id ||
    `manual-${new Date().toISOString().replace(/[:.]/g, '-')}`,
  );

  if (!/^[A-Za-z0-9._-]+$/.test(raw) || raw === '.' || raw === '..') {
    throw createStableError(
      'artifact_run_name_invalid',
      'Issue identifier cannot be used as an artifact directory name',
    );
  }

  return raw;
}
  1. Resolve and verify containment before any filesystem operation.
js
function resolveContainedRunDir(artifactRoot, runName) {
  const root = path.resolve(artifactRoot);
  const runDir = path.resolve(root, runName);
  const relative = path.relative(root, runDir);

  if (
    relative.length === 0 ||
    relative.startsWith(`..${path.sep}`) ||
    relative === '..' ||
    path.isAbsolute(relative)
  ) {
    throw createStableError(
      'artifact_path_invalid',
      'Artifact run directory escapes the artifact root',
    );
  }

  return runDir;
}
  1. Repeat containment validation immediately before recursive deletion. Destructive operations should not rely solely on an earlier check.

  2. Consider using an internal generated identifier. A random UUID or timestamp can be used for the physical directory while the original issue identifier remains metadata inside the manifest.

  3. Add regression tests covering:

    • ../target
    • ../../target
    • Absolute paths
    • POSIX and Windows path separators
    • . and ..
    • Empty or whitespace-only identifiers
    • Encoded or mixed-separator traversal attempts
    • Verification that recursive deletion cannot target a directory outside artifactRoot
  4. Use non-overwriting creation semantics where practical or explicitly handle existing run ...[truncated 65 chars]

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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (31)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/read-figma-context.mjs \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/read-figma-context.mjs \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/read-figma-context.mjs \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/read-figma-context.mjs \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/read-figma-context.mjs \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/validate-artifact.mjs <artifact-run-dir>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/smoke-figma-context.mjs \

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/output-schema.md (reported line 38)May include surrounding context.

md
- Generated artifacts and temporary issue JSON must not be committed.
- The script writes `.multica/figma-context/` and `.multica/tmp/` to `.git/info/exclude` when `--repo` is a Git repository.
- If that ignore check is not verified, `manifest.json` and `summary.md` include `artifact_ignore_unverified`.
- Artifacts must not contain access tokens, refresh tokens, client secrets, Authorization headers, or temporary signed Figma image URLs.
- `manifest.json` records `targetScreenshot`, `parentScreenshot`, and `candidateScreenshots`; each screenshot path must be local to the artifact run directory.
- `parentScreenshot` is `null` when parent context cannot be located or the parent export fails.
- `candidateScreenshots` is an array of `{ nodeId, name, source, path }`; it may be empty when there are no extra candidates or the screenshot budget is exhausted.

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/lib/cli-args.mjs (reported line 133)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-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/lib/cli-args.mjs (reported line 134)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-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 · tests/cli-args.test.mjs (reported line 60)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-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 · tests/cli-args.test.mjs (reported line 72)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-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 · tests/cli-args.test.mjs (reported line 75)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-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 · tests/cli-args.test.mjs (reported line 76)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-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 · tests/figma-token-store.test.mjs (reported line 57)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-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 · tests/figma-token-store.test.mjs (reported line 88)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-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 · tests/figma-token-store.test.mjs (reported line 118)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-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 · tests/figma-token-store.test.mjs (reported line 137)May include surrounding context.

js
describe('ensureFigmaAccessToken', () => {
  it('imports a first token store from an env file with secure permissions', async () => {
    const tempDir = await makeTempDir();
    const envFile = path.join(tempDir, '.env');
    const tokenStorePath = path.join(tempDir, 'secrets', 'figma-oauth.json');
    await writeEnvFile(envFile, {
      FIGMA_CLIENT_ID: 'client-id-1',

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill instructs the agent to run local Node.js scripts that read credentials and access external services, but it does not declare any tool scope such as allowed tools or permissions. In an agent environment, this weakens containment and review because consumers cannot tell up front that the skill needs code execution and environment access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is described as only reading Figma design context, but this code also performs persistent local side effects by creating artifact directories and modifying Git ignore state. That mismatch can violate user expectations and trust boundaries: a read-only skill should not silently alter repository metadata, especially in an agent setting where users may not inspect every file operation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code appends entries to .git/info/exclude without any explicit confirmation at the point of action, causing hidden repository-state changes outside normal tracked files. While intended to prevent accidental commits of artifacts, silently editing Git configuration is security-relevant because it can conceal generated files from routine workflows and breaks the principle of least astonishment for a supposedly read-focused skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Several natural-language strings written into the generated summary are hard-coded in Chinese, including fallback descriptions, warnings, and implementation notes. Because the file does not offer user opt-in or a locale selection mechanism, this creates a language policy violation under the rule for forced language/locale behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest frames the skill as reading design context, which implies fetching and interpreting Figma data. This file also implements image export and persists downloaded screenshots to local storage via fs.mkdir/fs.writeFile, which is broader than a read-only context reader and changes local state.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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/lib/figma-token-store.mjs (reported line 9)May include surrounding context.

js
const TOKEN_SCHEMA_VERSION = 'figma-oauth-token/v1';
const REFRESH_BEFORE_EXPIRY_MS = 5 * 60 * 1000;
const FIGMA_OAUTH_TOKEN_URL = 'https://api.figma.com/v1/oauth/token';

const ENV_KEYS = [
  'FIGMA_CLIENT_ID',