Datadog Details Claude Code Skill Attack That Can Exfiltrate GitHub Tokens Before Model Review

· Original article ↗

Summary

Datadog Security Labs describes the Clawsights Claude Code skill’s attempt to steal GitHub tokens and shows dynamic-context commands can run before model review. It recommends reviewing skill locations, disabling shell execution, and monitoring agents.

Key points

  • The Clawsights skill attempted to retrieve a GitHub authentication token and upload it to clawsights[.]com.
  • Claude Code dynamic-context commands run during preprocessing, before the model sees the rendered skill; a later refusal cannot stop commands that have already executed.
  • Skills can load from enterprise, personal, project, plugin, nested-folder, and added-directory locations, creating multiple paths for untrusted instructions to enter an agent session.
  • In Datadog’s tests, Opus 4.6 rejected the original skill, but the dynamic-context variant had already executed its commands. Opus 4.7 later ran a modified skill in tests; the article frames this as an implementation observation, not a guarantee.
  • The article recommends reviewing all skill locations, requiring review of .claude/ changes, setting disableSkillShellExecution: true where possible, and monitoring suspicious processes and network activity.
  • The authors note that malicious skills could also be used for source-code reconnaissance, local secret discovery, package-manager tampering, or staging another payload, depending on permissions and settings.

Article Details

Attack Vectors
  • A malicious skill distributed through a public GitHub repository can be loaded into Claude Code from project, nested-folder, plugin, or added-directory skill locations.
  • Dynamic context commands prefixed with ! execute before the rendered skill reaches the model, allowing commands to run before model-level review or refusal.
  • The Clawsights skill attempted to retrieve a user's GitHub token with `gh auth token` and send it, along with usage-report data, to an upload endpoint using curl.
  • The article reports that the dynamic-context variant ran the credential retrieval and upload before the model could intervene; results varied across model versions and tests.
Defensive Notes
  • Review skills in personal, project-root, nested-project, plugin-provided, and added directories before opening a workspace in a coding agent.
  • Require code review for .claude/ changes and inspect dynamic context commands for network access, sensitive-file reads, and secret discovery.
  • Disable skill shell execution where possible by setting `disableSkillShellExecution`: true in managed settings.
  • Monitor developer workstations and agent environments for suspicious process execution, credential-file access, unexpected outbound connections, and configuration changes.
  • Treat search patterns as review leads rather than complete detections; malicious skills may use aliases, wrapper scripts, or encoded payloads.
  • If a skill may have executed, determine what ran, what it accessed, where it connected, and which credentials may need rotation.

Indicators of compromise

TypeIndicatorContext
URLhxxps[:]//clawsights[.]com/api/uploadUpload endpoint used by the malicious Clawsights skill to send a GitHub token and usage-report data.

MITRE ATT&CK

Vendors

Products

Related Articles