安全客•July 13, 2026•🇨🇳Translated from Chinese

Ghostcommit Attack: Malicious Prompts Hidden in PNG Images Hijack AI Coding Agents to Steal .env Secrets

A new supply-chain attack technique named Ghostcommit enables adversaries to conceal prompt-injection commands inside ordinary PNG images, thereby bypassing AI code-review systems and compelling coding agents to exfiltrate sensitive secrets such as .env configuration files.

Attack Principle and Comparative Verification

The ASSET Research Group conducted experiments showing that when a pull request directly contains plaintext instructions to steal a repository’s .env file, tools such as the Cursor vulnerability bot and CodeRabbit immediately detect the malicious command and flag it as a high-severity issue before the code is merged.

To circumvent these safeguards, the researchers split the attack payload into two parts: a seemingly legitimate specification document named AGENTS.md placed in the repository root, and a PNG image (docs/images/build-spec.png) that actually contains the complete malicious logic. The image instructs the agent to read the .env file byte-by-byte and encode its contents as an ASCII numeric sequence. Because most text-oriented review tools treat images as opaque binary files and CodeRabbit skips PNG files by default, the entire pull request passes without any security warnings.

Attack Trigger Flow

The theft does not occur at merge time. Instead, the trap activates later when a developer, in a separate session, asks the coding agent to implement ordinary functionality. The agent consults the already-merged AGENTS.md file, parses the referenced image, reads the local .env file, and emits a module-level constant (for example _PROV_CANARY) containing hundreds of numeric values. When these numbers are decoded, they reconstruct the complete plaintext of the .env file. In one real-world test using Claude Sonnet inside Cursor, the model produced a tuple of 311 numbers that, once decoded, revealed API keys, database addresses, and cloud credentials.

Two Major Detection Blind Spots Exploited

  • Malicious prompts are hidden inside images, rendering them invisible to human reviewers, regex scanners, and large-language-model tools that only analyze textual diffs.
  • Extracted secrets are disguised as numeric tuples; conventional secret-scanning tools that rely on string patterns fail to recognize ASCII-decodable number sequences.

Multi-Tool and Multi-Model Test Results

Researchers evaluated 11 combinations of coding tools and models. Results showed that whether the attack succeeds depends primarily on the agent framework rather than the underlying model. Cursor leaked .env contents with Claude Sonnet 4.6, Composer-2, and GPT-5.5. Antigravity leaked secrets with Sonnet, Gemini 3.1 Pro, and Gemini 3 Flash. In contrast, the Claude Code platform blocked the attack across its entire model family (Sonnet 4.6, Haiku 4.5, Opus 4.7). Notably, the same Sonnet model behaved differently across environments. In one extreme test, Antigravity running Opus initially computed the secrets but then autonomously removed the sensitive output after recognizing the social-engineering pattern; the same model inside Claude Code never read the AGENTS.md file and therefore never triggered its self-defense mechanism.

Self-Developed Defense Prototype

The research team built a lightweight multimodal GitHub code-review tool based on the open-source Gemma 4 model that runs on a single 4 GB GPU. The prototype combines three detection capabilities: invisible-character identification, code-structure analysis, and simultaneous LLM-based validation of both specification documents and embedded images. In stress testing it achieved 100 % interception of 15 known attack samples with zero false positives, detected 49 out of 50 attacks in 80 previously unseen real-world submissions, and correctly classified all 30 normal business pull requests without raising alerts. The team has open-sourced the complete proof-of-concept code, including the split-payload pull-request samples and numeric-decoding utilities, to help the security community develop countermeasures.

Related articles

Securitylab•AI Security

AI Investigators in SOCs: Limits of Autonomy, Prompt Injection Risks, and the Cost of Over-Reliance

A February 2026 Vectra AI survey of 1,450 security professionals revealed that organizations receive nearly 3,000 daily attack alerts on average, with 63% left unprocessed and 71% of respondents delaying critical tasks at least two days a week. The article examines the push to deploy autonomous AI agents for investigations in Security Operations Centers, highlighting how such systems often fail when confronted with real-world disorder such as inconsistent server timestamps, unapproved software installations, and incomplete logging. It stresses strict limits on AI decision-making authority, especially for blocking systems or revoking access, and warns against treating model confidence scores as reliable error probabilities. Prompt injection attacks via malicious emails, logs, or documents are identified as a novel threat that can manipulate language models into ignoring attacks or leaking data. Research from Microsoft involving 167 analysts showed that false “safe” verdicts from AI increased missed threats by 29 percentage points. The piece concludes that independent human verification of AI-closed cases remains essential to avoid hidden risks behind empty alert queues.

Habr•AI Security

Developers Build 5KB Pure-JavaScript Headless Browser to Bypass DuckDuckGo AI Chat Anti-Bot System

A detailed technical analysis reveals how a minimal 5,408-byte obfuscated JavaScript payload delivered via the x-vqd-hash-1 HTTP header can be executed inside a fully synthetic browser environment written in pure JavaScript. The implementation replicates enough of the Chrome DOM, HTML5 parser, V8 engine fingerprints, and iframe behavior to solve DuckDuckGo’s rotating anti-bot challenges without using any real browser engine. The resulting Telegram bot, called headless-duckapi, streams responses from multiple free models including GPT-6-luna, Claude-haiku-4-5, and Mistral-small-2603 while also supporting image generation and vision tasks. Four distinct challenge variants were deobfuscated, exposing checks that range from native-code string detection and subclassed Array behavior to precise HTML5 parsing of malformed markup. The entire solution runs in serverless isolates with no external dependencies, maintaining a solved challenge token across restarts via SQLite.

AntiMalware•AI Security

Swordfish Security Raises Investment from VIM Investments to Advance AI Protection and Secure Development Tools

VIM Investments' Pre-IPO 2 fund has acquired a 42.152% minority stake in Swordfish Security, a group combining cybersecurity consulting with tool development. The capital will support expansion of products focused on AI system protection and secure software development practices. Swordfish Security operates through AppSec Solutions, which builds DevSecOps and AI Security offerings, and maintains the Swordfish SAIMM framework for assessing AI protection maturity. Company representatives confirmed the deal but did not disclose the transaction value. The investment aims to shorten development cycles from customer requests to product releases while introducing new AI defense scenarios. Swordfish Security reported 52% revenue growth to 2.1 billion rubles in 2025, partly attributed to rising customer demand for AI security measures.

Habr•AI Security

Eliezer Yudkowsky Explains Why Clever Human-Designed Schemes Fail at ASI Alignment

Eliezer Yudkowsky published the essay Cat-Belling Problems following debates at the ILIAD-2026 conference on mathematical AI safety. The piece uses the historical example of Michael Lorrey's proposed reactionless L-drive to illustrate why complex compensatory systems cannot violate conservation of momentum. Yudkowsky argues that any spreadsheet or design claiming net thrust from standard physics components must contain an accounting error because every individual interaction preserves momentum. He extends the analogy to proposals for solving superalignment of ASI, noting that hidden patented compensators or uninspectable calculations do not change the underlying mathematical impossibility. The essay contrasts superficial generalizations like the Law of White Swans with deep laws derived from Noether's theorem and quantum mechanics. Richard Feynman's encounters with perpetual motion machines of the third kind are cited to show how claims of new physics require experimental demonstration rather than unverified tables.