T08 · Insecure Dependencies
- Location
SKILL.md:4- Finding
Unpinned Codemod Package Retrieval and Execution
- Content
View full analysis
Vulnerability Details
File Locations:
SKILL.md:4-6SKILL.md:30-34commands/codemod.md:9-13commands/codemod.md:22
Vulnerability Type: T08: Insecure Dependencies
Risk Level: MediumVulnerable Code
SKILL.md:4-6:yaml allowed-tools: - Bash(codemod *) - Bash(npx codemod *)SKILL.md:30-34:markdown - Dump AST shape: `echo 'const x = 23;' | npx codemod ai dump-ast --` - Dump AST for a file: `npx codemod ai dump-ast src/App.tsx` - Inspect node types for a language: `npx codemod ai node-types tsx` - List docs resources: `npx codemod ai docs` - Read/search docs: `npx codemod ai docs codemod-creation-workflow`commands/codemod.md:9-13:markdown - Codemod AI tools are available through CLI commands even when MCP is not configured. Use `npx codemod ai docs`, `npx codemod ai dump-ast`, `npx codemod ai node-types`, `npx codemod ai tools`, `npx codemod ai call`, `npx codemod ai resources`, and `npx codemod ai resource` as the user-reproducible fallback or default path. - For codemod authoring, read `codemod-creation-workflow-instructions` first via MCP or `npx codemod ai docs codemod-creation-workflow`. Before writing source-transform code, read `jssg-gotchas` and `ast-grep-gotchas` via MCP or CLI docs commands. Read `codemod-cli-instructions` only when exact command syntax is needed. - If registry search shows no exact package, run `codemod init` immediately. In headless/non-interactive flows, use `codemod init <path> --no-interactive` and pass only flags that come from the user or task; do not invent author, license, description, or git repository metadata. - Before stopping work on a codemod package, call `validate_codemod_package` via MCP or run `npx codemod ai call validate_codemod_package --input '{"package_path":"."}'`. - If the authoring request uses Node/LLRT APIs, capability-gated modules, or non-trivial multi-file JSSG work, also read ...[truncated 2745 chars]- Remediation
View remediation
Remediation Suggestions
- Require a trusted, preinstalled Codemod CLI and invoke it with
npx --no-install codemodor directly through a verified local binary. - Pin Codemod to an exact audited version rather than allowing implicit resolution of the current registry version.
- Record the dependency and integrity metadata in a committed lockfile, and require immutable or frozen-lockfile installation.
- Restrict package retrieval to an explicitly trusted registry and prevent repository or environment configuration from silently redirecting resolution.
- Prefer reviewed MCP integrations where available instead of dynamically downloading a CLI package.
- Narrow
Bash(npx codemod *)to the minimum reviewed commands and arguments required by the Skill. - Pin and review registry codemod packages before running them, even when the CLI itself is trusted.
- Run codemods in a sandbox with minimal filesystem access, no unnecessary credentials, and restricted network access.
- Preserve the existing dry-run and verification requirements, but do not treat them as protection against malicious package initialization or command execution.
- Require a trusted, preinstalled Codemod CLI and invoke it with
