Back to skill

Security audit

Baoyu Format Markdown

Security checks for vulnerabilities and agentic risk

Overview

This markdown formatter is mostly purpose-aligned, but it can overwrite files and automatically run unpinned npm tools, so users should review it before installing.

Install only if you are comfortable with a formatter that may create analysis files, may modify the original file in typography-only mode, and may fetch/execute npm packages at runtime. Prefer running it in a limited workspace, keep backups of documents, and pin or preinstall the required tools before using it on sensitive content.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
`. 7. npm resolves and may download the current package version because no project-local locked dependency exists. 8. Package-controlled code executes with the permissions and environment of the Agent or user. ### Impact Assessment Successful exploitation would provide arbitrary code execution with the privileges of the process running the Skill. Depending on that account's permissions, malicious package code could: - Read or alter the target document and other files accessible to the user. - Access envi ...[truncated 561 chars]:4
Finding

Unpinned Runtime Retrieval and Execution of npm Packages

Content
View full analysis

Vulnerability Details

File Location: scripts/autocorrect.ts, lines 4–9
Additional Location: SKILL.md, line 32
Vulnerability Type: Runtime execution of undeclared and unpinned third-party packages
Risk Level: Medium

Complete Code Snippets

scripts/autocorrect.ts, lines 4–9:

ts
export function applyAutocorrect(filePath: string): boolean {
  const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx";
  const result = spawnSync(npxCmd, ["autocorrect-node", "--fix", filePath], {
    stdio: "inherit",
  });
  return result.status === 0;
}

SKILL.md, line 32:

markdown
Scripts in `scripts/` subdirectory. `{baseDir}` = this SKILL.md's directory path. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun. Replace `{baseDir}` and `${BUN_X}` with actual values.

The package manifest does not declare autocorrect-node:

json
{
  "dependencies": {
    "remark-cjk-friendly": "^1.1.0",
    "remark-frontmatter": "^5.0.0",
    "remark-gfm": "^4.0.1",
    "remark-parse": "^11.0.0",
    "remark-stringify": "^11.0.0",
    "unified": "^11.0.5",
    "unist-util-visit": "^5.1.0",
    "yaml": "^2.8.2"
  }
}

Technical Analysis

The default formatting workflow invokes autocorrect-node through npx, but that package is neither declared in scripts/package.json nor pinned by the supplied lockfiles. If the executable is unavailable locally, npx may resolve and download it from the configured npm registry at runtime. The reviewed project therefore does not fully determine which code will execute.

The documented runtime fallback similarly uses npx -y bun without an exact version. The -y option suppresses confirmation, allowing npm to retrieve and execute a mutable package automatically.

This creates a supply-chain trust boundary at execution time. A compromised package release, registry account, registry configuration, or dependency-resolution path c ...[truncated 1822 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add autocorrect-node to scripts/package.json at an exact, reviewed version rather than using a version range.
  2. Regenerate and commit synchronized npm and Bun lockfiles containing that exact dependency and its integrity metadata.
  3. Invoke only the project-local locked executable, and prevent package-manager behavior that downloads missing packages implicitly. For example, use an npm mode equivalent to --no-install or resolve the executable from the local dependency directory.
  4. Replace the npx -y bun fallback with a requirement for a preinstalled, trusted Bun binary, or install a specific Bun release through a verified distribution mechanism with integrity or signature checks.
  5. Fail safely with a clear error when a required executable is unavailable instead of retrieving executable code automatically.
  6. Use exact versions for direct dependencies and perform periodic dependency provenance, vulnerability, and integrity reviews.
  7. In sensitive environments, restrict outbound network access during Skill execution and run the formatter in a sandbox with access limited to the intended input and output files.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A skill that claims comprehensive formatting support but may not implement those features is primarily a trust and safety problem: operators may invoke it assuming limited, deterministic transformations while hidden or omitted behaviors remain undocumented. In this context, inaccurate capability claims increase the chance of unsafe automation and unintended file handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A skill that claims comprehensive formatting support but may not implement those features is primarily a trust and safety problem: operators may invoke it assuming limited, deterministic transformations while hidden or omitted behaviors remain undocumented. In this context, inaccurate capability claims increase the chance of unsafe automation and unintended file handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A skill that claims comprehensive formatting support but may not implement those features is primarily a trust and safety problem: operators may invoke it assuming limited, deterministic transformations while hidden or omitted behaviors remain undocumented. In this context, inaccurate capability claims increase the chance of unsafe automation and unintended file handling.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document says to never add, delete, or rewrite content, but later instructs generating title/summary/description and removing an H1 from the body. Contradictory directives are dangerous in agent skills because they undermine safe-policy interpretation and can mask substantive edits behind a promise of harmless formatting.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `scripts/main.ts` | Main entry point with CLI options (uses remark-cjk-friendly for CJK emphasis) |

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says output goes to {filename}-formatted.md, but the workflow also writes an analysis file and may modify the original in place. This discrepancy hides side effects from users and orchestration systems, increasing the risk of unexpected data modification or artifact sprawl.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description says to use the skill when the user asks to "beautify article", "add formatting", or improve article layout. These phrases are relatively broad and can overlap with ordinary writing-assistance requests, without clear negative examples or scope limits for when this skill should not activate.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill claims it only adjusts formatting without changing content, yet the workflow includes generating analysis artifacts and metadata such as title, summary, and description. This is risky because downstream users may treat it as non-substantive editing while it actually creates new content and additional files.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The skill directs the runtime to execute npx -y bun without pinning a specific package version or integrity reference. That creates a supply-chain risk: the resolved package can change over time or be substituted upstream, leading to execution of unexpected code during skill use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill allows typography-only mode to modify the original file directly, but the warning is buried inside the workflow rather than surfaced as a prominent consent boundary. In-place modification can destroy user data or overwrite important content, especially if the skill is auto-invoked from broad editing requests.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest says this skill formats markdown, but the implementation runs a generic autocorrection tool over an arbitrary provided file path. That mismatch increases risk because users and calling systems may trust the skill to perform narrow markdown beautification while it actually modifies content through a broader external tool, potentially altering non-markdown files or invoking unreviewed behavior from a dependency.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill's stated purpose is to format plain text or markdown files, but this implementation accomplishes that by spawning an external npx autocorrect-node process. Launching subprocesses is not an obviously required capability for a formatter skill and introduces execution behavior beyond simple in-process text transformation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The implementation writes formatted content back to the original filePath with writeFileSync(filePath, formattedContent, "utf-8"), which contradicts the manifest claim that output goes to {filename}-formatted.md. In an agent context, this can silently destroy or alter user data, especially when users rely on the documented behavior to preserve the source file.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The skill instructs creation of an analysis file without clearly warning the user that an additional file will be written. While lower impact than overwriting the original, undisclosed file creation can leak sensitive content into new locations and violate user expectations about side effects.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: yaml==2.8.2 — 1 advisory(ies): CVE-2026-33532 (yaml is vulnerable to Stack Overflow via deeply nested YAML collections)

Low
Category
Supply Chain
Confidence
88% confidence
Finding

This appears to be a true dependency vulnerability: the lockfile pins yaml 2.8.2, and the advisory describes a stack overflow caused by deeply nested YAML collections. In this skill, YAML parsing is relevant because the formatter explicitly handles frontmatter, so attacker-controlled markdown with maliciously deep YAML frontmatter could crash the process or cause a denial of service during formatting rather than enabling direct code execution.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · scripts/package.json (reported line 3)May include surrounding context.

json
{
  "dependencies": {
    "remark-cjk-friendly": "^1.1.0",
    "remark-frontmatter": "^5.0.0",
    "remark-gfm": "^4.0.1",
    "remark-parse": "^11.0.0",

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · scripts/package.json (reported line 4)May include surrounding context.

json
{
  "dependencies": {
    "remark-cjk-friendly": "^1.1.0",
    "remark-frontmatter": "^5.0.0",
    "remark-gfm": "^4.0.1",
    "remark-parse": "^11.0.0",
    "remark-stringify": "^11.0.0",

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · scripts/package.json (reported line 5)May include surrounding context.

json
"dependencies": {
    "remark-cjk-friendly": "^1.1.0",
    "remark-frontmatter": "^5.0.0",
    "remark-gfm": "^4.0.1",
    "remark-parse": "^11.0.0",
    "remark-stringify": "^11.0.0",
    "unified": "^11.0.5",

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · scripts/package.json (reported line 6)May include surrounding context.

json
"remark-cjk-friendly": "^1.1.0",
    "remark-frontmatter": "^5.0.0",
    "remark-gfm": "^4.0.1",
    "remark-parse": "^11.0.0",
    "remark-stringify": "^11.0.0",
    "unified": "^11.0.5",
    "unist-util-visit": "^5.1.0",

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · scripts/package.json (reported line 7)May include surrounding context.

json
"remark-frontmatter": "^5.0.0",
    "remark-gfm": "^4.0.1",
    "remark-parse": "^11.0.0",
    "remark-stringify": "^11.0.0",
    "unified": "^11.0.5",
    "unist-util-visit": "^5.1.0",
    "yaml": "^2.8.2"

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · scripts/package.json (reported line 8)May include surrounding context.

json
"remark-gfm": "^4.0.1",
    "remark-parse": "^11.0.0",
    "remark-stringify": "^11.0.0",
    "unified": "^11.0.5",
    "unist-util-visit": "^5.1.0",
    "yaml": "^2.8.2"
  }

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · scripts/package.json (reported line 9)May include surrounding context.

json
"remark-parse": "^11.0.0",
    "remark-stringify": "^11.0.0",
    "unified": "^11.0.5",
    "unist-util-visit": "^5.1.0",
    "yaml": "^2.8.2"
  }
}

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · scripts/package.json (reported line 10)May include surrounding context.

json
"remark-stringify": "^11.0.0",
    "unified": "^11.0.5",
    "unist-util-visit": "^5.1.0",
    "yaml": "^2.8.2"
  }
}

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/autocorrect.ts:6