T08 · Insecure Dependencies
- Location
scripts/upgrade_cc.py:20- Finding
Unpinned Global npm Package Installation Through a Mutable Registry Tag
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a disclosed local audit and remediation helper, but users should be careful because its optional fix globally upgrades Claude Code from a mutable npm latest tag.
Install only if you want a local Claude Code binary audit and understand the optional remediation. Run the audit first; do not run upgrade_cc.py --apply unless you approve a global npm package change, and prefer verifying or pinning the exact Claude Code version instead of relying on latest.
scripts/upgrade_cc.py:20Unpinned Global npm Package Installation Through a Mutable Registry Tag
The skill frames the issue as a scanner for marking 中国用户 and repeatedly emphasizes nationality-based targeting without documenting a clear policy basis, evidence standard, or user-consent safeguards. This can encourage discriminatory handling, reputational harm, or misuse of the skill in ways that target users by nationality rather than by a neutral technical indicator.
The skill instructs the agent to run local Python scripts and potentially perform a global npm install -g, but it does not declare any permissions or allowed-tools scope. That mismatch increases the chance the skill is invoked with broader shell access than users or reviewers expect, enabling unintended command execution on the host.
The trigger list contains broad phrases like upgrade claude-code, 清理 Claude Code, and claude code unicode, which could match ordinary support or maintenance requests unrelated to this specific audit skill. Overbroad invocation raises the risk that the skill runs shell-based audit or upgrade steps in contexts where the user did not intend to authorize those actions.
This markdown file is written entirely in Chinese and does not indicate any user language choice or opt-in. Under the policy rule for natural-language violations, forcing a specific language without documented choice or justification is a reportable locale/language policy issue.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if os.path.exists(path) and os.path.getsize(path) > 1_000_000:
return path
try:
root = subprocess.check_output(["npm","root","-g"], text=True).strip()
p = os.path.join(root,"@anthropic-ai","claude-code","bin","claude.exe")
if os.path.exists(p):
return p
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def get_version():
try:
out = subprocess.check_output(["claude","--version"], text=True, stderr=subprocess.STDOUT)
m = re.search(r"(\d+)\.(\d+)\.(\d+)", out)
if m:
return tuple(int(x) for x in m.groups())
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(cmd):
print("+ " + " ".join(cmd))
return subprocess.run(cmd)
if __name__ == "__main__":
apply = "--apply" in sys.argv