T08 · Insecure Dependencies
- Location
scripts/run_memberstack.py:52- Finding
Unpinned npm Package Is Downloaded and Executed Through npx
- Content
View full analysis
list[str]: which = shutil.which("memberstack-cli") or shutil.which("memberstack") if which: return [which] return ["npx", "memberstack-cli"] ``` ```python cmd_parts = find_cli() + args try: result = subprocess.run( cmd_parts, capture_output=True, text=True, timeout=60, ) ``` Related installation and authentication instructions also use an unpinned package: ```bash npx memberstack-cli auth login npm install -g memberstack-cli ``` ### Technical Analysis When no local `memberstack-cli` or `memberstack` executable is available, the wrapper falls back to `npx memberstack-cli`. No package version, lockfile, integrity hash, or publisher verification is specified. Depending on the local npm/npx configuration and cache state, `npx` can retrieve the current package release from the configured npm registry and execute its lifecycle or runtime code. Consequently, the code ultimately executed can change after this Skill has been reviewed. This is a supply-chain trust issue rather than evidence that the currently referenced package is malicious. However, a compromised publisher account, malicious future release, registry substitution, or unsafe custom npm registry could turn an apparently legitimate Skill invocation into arbitrary local code execution. ### Attack Path 1. The host does not have a local `memberstack-cli` or `memberstack` executable. 2. The user or Agent invokes `scripts/run_memberstack.py`. 3. `find_cli()` selects `npx memberstack-cli`. 4. `npx` resolves the unpinned package through the configured npm registry. 5. An attacker-controlled or compromised package release is downloaded and executed. 6. The package runs with the privil ...[truncated 876 chars]- Remediation
View remediation
