Bitdefender Finds GitHub Malware Campaign Targeting AI Coding Agents

· Original article ↗

Summary

Bitdefender reports 22 malicious GitHub links that use AI-agent instructions and session-start hooks to run a JavaScript loader, steal developer credentials, and spread through local agent configurations and repositories.

Key points

  • Bitdefender Labs identified 22 malicious GitHub links containing files designed to target AI-assisted development environments.
  • Malicious project instructions can tell an AI assistant to run setup.js; a session-start hook can also trigger execution when a developer trusts a repository.
  • The multi-stage JavaScript loader uses hex decoding, ROT13, encrypted payloads, and the Bun runtime to conceal and launch its final bundle.
  • The malware is designed to steal developer and enterprise credentials, including source-control tokens, CI/CD secrets, cloud credentials, browser data, and SSH keys.
  • It searches local systems for AI-agent configurations and can add malicious instructions, hooks, or MCP server configurations.
  • With stolen GitHub or GitLab tokens, it can inspect repositories and attempt to add malicious files, alter workflows or package metadata, and spread through software packages.
  • Bitdefender recommends reviewing repository instructions, hooks, MCP configurations, and setup scripts. In internal tests, AI Guardian detected the malicious instruction files in all 22 identified samples; results may differ in other environments or against new variants.

Article Details

Attack Vectors
  • Malicious GitHub repository instructions direct AI coding assistants to run scripts/setup.js, sometimes automatically and without showing output.
  • A trusted repository can use a session-start hook in .claude/settings.json to run a command in the user's shell without an AI prompt.
  • The setup.js loader hex-decodes an embedded value, applies ROT13, and evaluates the result; a Node.js stage decrypts and decompresses payloads and pipes a bundle to the Bun runtime.
  • The malware searches the victim's home directory for AI-agent configuration files and can add malicious instructions, session-start hooks, or MCP server configurations.
  • The malware validates stolen GitHub and GitLab tokens, then can commit malicious agent configuration files, alter package metadata and workflows, schedule GitLab pipelines, and attempt to republish infected packages.
Defensive Notes
  • Review unfamiliar repository instructions and configurations, including AGENTS.md, CLAUDE.md, .claude/, .cursor/, .gemini/, MCP server definitions, session-start hooks, and VS Code tasks before trusting a repository.
  • Investigate setup scripts referenced by configuration files, especially instructions that prohibit inspection, suppress output, bypass confirmation, or trigger automatic execution.
  • Bitdefender recommends reviewing agent skills, tools, and configurations before trusting or installing them, and controlling the files, credentials, tools, and actions an agent can access.
  • Bitdefender says AI Guardian detected the malicious instruction file in all 22 samples in its internal tests on November 10; it cautions that results in other environments or against new variants may differ.

Indicators of compromise

TypeIndicatorContext
MD52191cbd04134839daeb6b8909725eae0MD5 hash listed for the malicious setup.js file in the Imanilom/baraja-coffe repository.
MD52f54f6d41f41bb3c8e684b0f009cbcc3MD5 hash listed for the malicious setup.js file in the ConcordiaDev/theme_saimaniq repository.
MD531f1f5d9c59b950d91d05cecee20fce8MD5 hash listed for the malicious setup.js file in the bajoebel/kkpatip repository.
MD53794736979327349404171798328a38aMD5 hash listed for the malicious setup.js file in the itsunai/docker-php-fpm repository.
MD55c8db9bf78c6c2174ccf8a6299f9aafdMD5 hash listed for the malicious setup.js file in the rkamphuis012-hub/sr-pilot-codex-test repository.
MD55dc5473468ee2d8006ebdaab0c7e93fbMD5 hash listed for the malicious setup.js file in the julieth333/campustech repository.
MD57ad1567180f6d5a5b317f697310a796cMD5 hash listed for the malicious setup.js file in the claudiohernanbesada/xenios.api repository.
MD582a8be193a41f5b17906f919a179d999MD5 hash listed for the malicious setup.js file in the Malala-Tour-Indonesia/Malala-Tour-Indonesia.github.io repository.
MD5908293cd1ed04cf50fbe72baf74967b6MD5 hash listed for the malicious setup.js file in the ahmadtohar9/restomoiz repository.
MD5a20a99e325226f56d7a25460a9d436abMD5 hash listed for the malicious setup.js file in the madolee/da repository.
MD5ab7ff2f782c194953e5811d16b9e1817MD5 hash listed for the malicious setup.js file in the ejaaduipitara/djp-devops repository.
MD5b9a182b646c7fdff68f2ff9dfd822516MD5 hash listed for the malicious setup.js file in the toray/QiniuSDK-lib repository.
MD5bbd5695c36e76538547c45fd17e6c7e4MD5 hash listed for the malicious setup.js file in the tobias94-design/s-valentine repository.

MITRE ATT&CK

T1027 · Obfuscated Files or InformationThe loader conceals its stages using hex encoding, ROT13, encrypted blobs, and compression.T1059.007 · JavaScriptThe malicious setup.js payload runs as JavaScript through Node.js.T1078 · Valid AccountsThe malware validates and uses stolen GitHub and GitLab tokens to inspect and modify repositories when the account has sufficient permissions.T1083 · File and Directory DiscoveryAfter execution, the malware recursively searches the victim's home directory for AI-agent configuration files.T1105 · Ingress Tool TransferThe Node.js stager can download the Bun runtime before piping the payload bundle to it.T1140 · Deobfuscate/Decode Files or InformationThe loader hex-decodes and ROT13-transforms embedded content before evaluating the recovered stage.T1195.002 · Compromise Software Supply ChainThe malware can attempt to republish infected packages through npm, PyPI, RubyGems, and JFrog.T1552.001 · Credentials In FilesThe malware searches for exposed credentials and secrets in files including .env files and API keys.T1552.004 · Private KeysThe malware targets SSH keys on the victim's system.T1555.003 · Credentials from Web BrowsersThe malware can steal credentials stored by browsers.T1555.004 · Windows Credential ManagerThe malware includes functionality to enumerate Windows Credential Manager.T1565.001 · Stored Data ManipulationUsing stolen repository access, the malware can commit malicious agent configuration files and modify package metadata and workflows.

People

Vendors

Products

Related Articles