T08 · Insecure Dependencies
- Location
SKILL.md:155- Finding
Unpinned Global Installation of Executable Third-Party Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 155–162
Vulnerability Type: Supply-chain exposure through an unpinned executable dependency
Risk Level: MediumVulnerable Code:
bash # Install mermaid CLI npm install -g @mermaid-js/mermaid-cli # Render .mmd files to SVG mmdc -i diagram.mmd -o diagram.svg # Reference in slides # Technical Analysis
The documented command installs the latest available version of
@mermaid-js/mermaid-cliglobally without an exact version, lockfile, or integrity verification. Package releases and their transitive dependencies can change after the Skill has been audited. If the package distribution channel, maintainer account, or a transitive dependency is compromised, installation lifecycle scripts or subsequently invoked package code could execute attacker-controlled instructions.Global installation broadens the effect because the package is installed outside a project-scoped dependency environment and exposes the
mmdcexecutable system-wide for the current user. The audited content does not demonstrate that this package is presently malicious; the confirmed issue is the unsafe dependency acquisition practice.Attack Path
- An attacker compromises the npm package, a maintainer account, or a transitive dependency used by a future release.
- A user follows the Skill and runs
npm install -g @mermaid-js/mermaid-cli. - npm retrieves the compromised, unpinned release and may execute its installation lifecycle scripts.
- Malicious code runs with the privileges of the user executing npm.
- The globally installed
mmdccommand can also execute the malicious payload during later diagram-rendering operations.
Impact Assessment
Successful exploitation could permit arbitrary code execution with the installing user's privileges. Depending on that user's permissions and environment, the payload could access us ...[truncated 330 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin
@mermaid-js/mermaid-clito a reviewed exact version rather than resolving the latest release. - Install it as a project-local development dependency instead of globally:
bash npm install --save-dev --save-exact @mermaid-js/mermaid-cli@REVIEWED_VERSION - Commit and enforce a lockfile, and use
npm ciin automated or reproducible environments. - Invoke the locked local executable with:
bash npx --no-install mmdc -i diagram.mmd -o diagram.svg - Review transitive dependencies and installation lifecycle scripts before upgrades.
- Use package integrity verification and dependency scanning in CI.
- Run rendering in a sandbox or minimally privileged environment when processing untrusted diagrams.
- Pin
