claude-code - 💡(How to fix) Fix Security: warn users in docs against auto-installing third-party plugins that write global hooks [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48100Fetched 2026-04-15 06:33:12
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
labeled ×4mentioned ×1subscribed ×1

Error Message

The current Claude Code hooks documentation (code.claude.com/docs/en/hooks) does not warn users about any of this.

RAW_BUFFERClick to expand / collapse

Today an extended comment-spam pattern by @junaidtitan (Junaid Q / Ruya-AI) across 50+ claude-code issues (see #48041) led to a code audit of his promoted tool "Cozempic". Findings (full detail in #48041):

  • npm install silently writes a SessionStart hook into the user's global ~/.claude/settings.json
  • That hook runs uv pip install --upgrade cozempic on every session → auto-deploys any future PyPI release with no consent
  • Registers a PostToolUse hook with empty matcher — sees every tool call
  • Phones home via urlopen to a third-party counter API

No currently-malicious code, but the architecture is a pre-staged supply chain backdoor. Cozempic is one example. The general problem:

  1. npm install <x> can silently modify ~/.claude/settings.json
  2. Global hooks run on every Claude Code session, across every project
  3. PostToolUse with empty matcher has full session visibility
  4. Auto-upgrade inside hooks removes the user from the trust chain entirely

The current Claude Code hooks documentation (code.claude.com/docs/en/hooks) does not warn users about any of this.

Requesting:

  • A prominent warning in claude-code documentation: "Third-party plugins that write hooks into ~/.claude/settings.json at install time run on every session across every project. Only install from sources you trust. Check the code before npm install."
  • A claude-code hooks audit or claude-code plugins list command that shows all registered hooks and the commands they run, so users can inspect what's running on their machine.
  • Consider requiring user confirmation before any third-party installer can modify ~/.claude/settings.json.

This is not about Cozempic specifically. This is about the fact that the install path silently permits this today, and a pattern of actors exploiting bug complaints as distribution channels is already active in this repo.

extent analysis

TL;DR

To mitigate the supply chain backdoor vulnerability, a prominent warning should be added to the Claude Code documentation, and a claude-code hooks audit command should be implemented to allow users to inspect registered hooks.

Guidance

  • Add a warning to the Claude Code documentation to inform users about the potential risks of third-party plugins writing hooks into ~/.claude/settings.json at install time.
  • Implement a claude-code hooks audit or claude-code plugins list command to display all registered hooks and the commands they run, enabling users to inspect and verify the hooks running on their machine.
  • Consider introducing a user confirmation step before allowing third-party installers to modify ~/.claude/settings.json to prevent silent modifications.
  • Review and update the documentation to ensure it accurately reflects the potential risks and consequences of installing third-party plugins.

Example

No code snippet is provided as it is not necessary for this specific issue.

Notes

The proposed solution focuses on mitigating the vulnerability by increasing user awareness and providing tools for inspection and control. It does not address the underlying issue of how npm install can silently modify ~/.claude/settings.json, which may require further changes to the installation process.

Recommendation

Apply a workaround by adding a prominent warning to the documentation and implementing the claude-code hooks audit command, as this will provide users with necessary information and tools to manage the risk associated with third-party plugins.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING