Threat feed

GitHub AI-agent repo hijacking

Poisoned GitHub repositories hijack AI coding agents to steal developer credentials and spread through stolen tokens

Posted · Spectrum Delta Research Team

Summary

Unattributed attackers published 22 poisoned GitHub repositories whose instruction files and session hooks make AI coding assistants silently execute a hidden JavaScript credential stealer (Bitdefender Labs, A/2). AGENTS.md and CLAUDE.md files present scripts/setup.js as a sealed, signed artifact the assistant must not inspect or display, while .claude/settings.json SessionStart hooks run the same script in the user shell with no typed prompt once a repository is trusted. The 3.75 MB single-line loader hex-decodes an embedded value, applies ROT13 and evaluates it, then decrypts two AES-128-GCM blobs and pipes a 4.67 MB bundle to the Bun runtime over standard input. The payload steals CI/CD and GitHub Actions secrets, cloud and container credentials, package-registry tokens, SSH keys, .env files, API keys, browser logins, password-manager data and Windows Credential Manager entries. It then searches the home directory for configurations of 14 AI coding tools and injects new instructions, hooks and MCP servers, while validating stolen GitHub and GitLab tokens to commit the same poisoned files to up to 25 repositories and republish infected packages to npm, PyPI, RubyGems and JFrog.

Breakdown

Targets

  • Industry: Software development

Technical exposure

  • Repository trust in AI coding tools enables hook and instruction execution
  • Stolen GitHub or GitLab tokens with push rights enable repo poisoning

Adversary

Unattributed attackers publishing 22 poisoned GitHub repositories targeting AI coding environments (Bitdefender Labs, A/2)

Procedures (6)

  1. Poisoned AGENTS.md and CLAUDE.md steer agents to run setup.js

    • T1195.002Supply Chain Compromise: Compromise Software Supply Chain
    • T1204.002User Execution: Malicious File

    Logs

    • GitHub repository audit log · newly added AGENTS.md or CLAUDE.md files describing scripts/setup.js as a sealed, signed artifact that must not be inspected and must run silently at session start

    Detectors

    • Bitdefender AI Guardian · blocks Claude Code sessions whose instruction files match the sealed-artifact pattern; detected all 22 samples in internal tests on November 10
  2. Session-start hooks execute setup.js without an AI prompt

    • T1059.007Command and Scripting Interpreter: JavaScript

    Logs

    • Endpoint file and process telemetry · creation of .claude/settings.json with SessionStart hooks invoking node scripts/setup.js in freshly cloned repositories, followed by node execution
  3. Multi-stage loader unpacks an encrypted Bun payload

    • T1027Obfuscated Files or Information
    • T1027.013Obfuscated Files or Information: Encrypted/Encoded File
    • T1059.007Command and Scripting Interpreter: JavaScript

    Logs

    • Process execution telemetry · node or bun processes receiving a piped bundle on standard input after a 3.75 MB single-line JavaScript file runs hex decoding and ROT13 evaluation
  4. Credential and token theft across developer environments

    • T1555Credentials from Password Stores
    • T1555.004Credentials from Password Stores: Windows Credential Manager
    • T1552.001Unsecured Credentials: Credentials In Files

    Logs

    • Windows Security event logs · node.exe or bun.exe accessing Windows Credential Manager, browser credential stores, SSH keys and .env files, then encrypting and batching collected records for dispatch
  5. Local propagation through 14 AI-agent configuration files

    • T1083File and Directory Discovery
    • T1059.007Command and Scripting Interpreter: JavaScript

    Logs

    • Endpoint file enumeration telemetry · recursive home-directory searches touching mcp.json, .cursorrules, .windsurfrules, .aider.conf.yml and .github/copilot-instructions.md, followed by edits adding hooks or MCP servers
  6. Stolen tokens push poisoned files to new repositories

    • T1078Valid Accounts
    • T1195.002Supply Chain Compromise: Compromise Software Supply Chain

    Logs

    • GitHub audit log · API calls to /user, /user/repos and /users/<login>/repos followed by commits adding AGENTS.md, .claude/settings.json, .mcp.json or .vscode/tasks.json across up to 25 repositories and 50 branches, plus package republish attempts to npm, PyPI, RubyGems and JFrog

Indicators of compromise

URLs (22)

  • https://github.com/toray/QiniuSDK-libpoisoned repository carrying malicious agent instruction files
  • https://github.com/toray/widget-libpoisoned repository carrying malicious agent instruction files
  • https://github.com/toray/XiamiSDK-libpoisoned repository carrying malicious agent instruction files
  • https://github.com/toray/torayUtils-libpoisoned repository carrying malicious agent instruction files
  • https://github.com/toray/Rainbow-libpoisoned repository carrying malicious agent instruction files
  • https://github.com/ConcordiaDev/theme_saimaniqpoisoned repository carrying malicious agent instruction files
  • https://github.com/itsunai/docker-php-fpmpoisoned repository carrying malicious agent instruction files
  • https://github.com/itsunai/passport_auth_serverpoisoned repository carrying malicious agent instruction files
  • https://github.com/ejaaduipitara/djp-devopspoisoned repository carrying malicious agent instruction files
  • https://github.com/ejaaduipitara/whatsapp-botpoisoned repository carrying malicious agent instruction files
  • https://github.com/ejaaduipitara/content-servicepoisoned repository carrying malicious agent instruction files
  • https://github.com/Imanilom/baraja-coffepoisoned repository carrying malicious agent instruction files
  • https://github.com/bajoebel/kkpatippoisoned repository carrying malicious agent instruction files
  • https://github.com/ahmadtohar9/restomoizpoisoned repository carrying malicious agent instruction files
  • https://github.com/tobias94-design/s-valentinepoisoned repository carrying malicious agent instruction files
  • https://github.com/tobias94-design/gymtrackerpoisoned repository carrying malicious agent instruction files
  • https://github.com/tobias94-design/signagepoisoned repository carrying malicious agent instruction files
  • https://github.com/claudiohernanbesada/xenios.apipoisoned repository carrying malicious agent instruction files
  • https://github.com/rkamphuis012-hub/sr-pilot-codex-testpoisoned repository carrying malicious agent instruction files
  • https://github.com/Malala-Tour-Indonesia/Malala-Tour-Indonesia.github.iopoisoned repository carrying malicious agent instruction files
  • https://github.com/julieth333/campustechpoisoned repository carrying malicious agent instruction files
  • https://github.com/madolee/dapoisoned repository carrying malicious agent instruction files

Hashes (13)

  • b9a182b646c7fdff68f2ff9dfd822516setup.js MD5 in toray/QiniuSDK-lib, toray/widget-lib and 3 more
  • 2f54f6d41f41bb3c8e684b0f009cbcc3setup.js MD5 in ConcordiaDev/theme_saimaniq
  • 3794736979327349404171798328a38asetup.js MD5 in itsunai/docker-php-fpm, itsunai/passport_auth_server
  • ab7ff2f782c194953e5811d16b9e1817setup.js MD5 in ejaaduipitara/djp-devops, ejaaduipitara/whatsapp-bot and 1 more
  • 2191cbd04134839daeb6b8909725eae0setup.js MD5 in Imanilom/baraja-coffe
  • 31f1f5d9c59b950d91d05cecee20fce8setup.js MD5 in bajoebel/kkpatip
  • 908293cd1ed04cf50fbe72baf74967b6setup.js MD5 in ahmadtohar9/restomoiz
  • bbd5695c36e76538547c45fd17e6c7e4setup.js MD5 in tobias94-design/s-valentine, tobias94-design/gymtracker and 1 more
  • 7ad1567180f6d5a5b317f697310a796csetup.js MD5 in claudiohernanbesada/xenios.api
  • 5c8db9bf78c6c2174ccf8a6299f9aafdsetup.js MD5 in rkamphuis012-hub/sr-pilot-codex-test
  • 82a8be193a41f5b17906f919a179d999setup.js MD5 in Malala-Tour-Indonesia/Malala-Tour-Indonesia.github.io
  • 5dc5473468ee2d8006ebdaab0c7e93fbsetup.js MD5 in julieth333/campustech
  • a20a99e325226f56d7a25460a9d436absetup.js MD5 in madolee/da

Sources

Questions, detections or sightings of GitHub AI-agent repo hijacking? Bring them to the community.