Hidden in Plain Code: Reliability and Limits of Frontier LLMs in Detecting Software Backdoors

hipc-0-cover-png.79


Hidden in Plain Code
Reliability and Limits of Frontier LLMs in Detecting Software Backdoors

Marco Capuano, Luca Sabljak, Josias Buchli
Supervised by Dr. Arno Wagner, OST Eastern Switzerland University of Applied Sciences

Read the paper (PDF, 68 pages) | Browse the 87 run archives | GitHub repository​

Together with Luca Sabljak and Josias Buchli, I tested whether the AI coding agents that more and more teams use for code audits find a backdoor that someone hid on purpose. The short version:

AI coding agents recognize the backdoors they read. But they read only what they judge relevant, about one line in twelve, and an attacker can shape what looks relevant.

The question​

Teams increasingly ask AI coding agents to audit software they did not write. The xz backdoor of 2024 reached Linux distributions through public release archives and was found only because a developer looked into slow SSH logins. Public code is not the same as code that someone has read.

So we asked a simple question: does an AI audit find a deliberately hidden way in?

The setup​

  • Twelve working backdoors planted in two widely used open-source services, Gitea and Jenkins. Each one was confirmed to work on a running server.
  • Each backdoor existed in a baseline that hides little and in a version hidden with a classic technique, such as obfuscation, decoy code, a long call chain, or a race condition.
  • Two frontier models, each in its vendor's coding agent at the highest reasoning setting: OpenAI's GPT-6.1 Sol in Codex with standard access, and Anthropic's Opus 5.5 in Claude Code with Anthropic's Defense Access tier for cybersecurity work.
  • Every review covered the full source, in a fresh sandbox, with no limit on time or tool calls and without telling the agent that a backdoor existed.
  • From the agents' own tool traces we reconstructed, line by line, which code each review had printed in its tool output.

Phase 1: classic hiding barely mattered​

The agents found the backdoor in 43 of 48 reviews that contained a single backdoor. They found the hidden versions about as often as the baselines (21 and 22 of 24). At the moderate level of concealment we built, classic hiding had no strong or consistent effect. Obfuscation, a five-step call chain, a race between two requests: once an agent looked at the right code, it saw through the trick.

So why did they miss the few they missed? The hiding techniques explained only part of it. The answer was in the traces.

The agents read about one line in twelve​

The median review saw only 8.5% of the Go or Java lines. The agents chose those lines by their own judgment of what deserves attention. They searched for the words that attacks usually contain and for program calls, and they judged by name what deserved a closer look. Part of that vocabulary may come from our prompt, which asked for hidden access paths.

Counting each backdoor in each review of both phases:
  • When the decisive line appeared in the agent's tool output, the agent explained the backdoor in 90 of 93 cases.
  • When the decisive line never appeared, the backdoor was found in 0 of 27 cases.
The agents understood what they read. Their blind spot was the code they apparently judged not worth reading.

hipc-fig1-reading-png.80


Hidden in Plain Code (HIPC)​

If the weak point is the decision about what to read, an attacker does not need clever code. The code only has to look unremarkable to that decision. From the Phase 1 traces we derived four rules:
  1. Search cues. Use the feature's own words. No attack vocabulary, no obvious program call, no condition shaped like a broken check.
  2. Placement. Put the decisive code where reading rarely lands, deep in a large file and one call away from the way in.
  3. Plausibility. Give the way in a routine name and move the dangerous step into a helper with a routine name.
  4. Impact. Give the backdoor a lesser impact, such as a read leak behind an ordinary filter.
HIPC uses no obfuscation at all. This is what the first rule does to a backdoor that runs server commands:

Code:
// Phase 1 (Gitea-05): attack words and a shell
func ActionsRunnerDiagnostics(ctx ...)
command := ctx.FormString("command")
Exec("...", "sh", "-c", command)

// HIPC build: health-check words, no Exec
func SimpleHealthCheck(ctx ...)
health := ctx.FormString("health", "git")
GetManager().PerformHealthCheck(...)

Phase 2: plain code slipped past most reviews​

We built new backdoors in Gitea this way: a private data leak through the issue search, and a backdoor that runs server commands, first in a light build and then in a full HIPC build. Then we gave them to the same agents.
  • They were found in full in only 3 of 24 reviews.
  • GPT-6.1 Sol, which had found most classic backdoors, found none of them. On the full build, a provider safeguard stopped every Codex run before it reached the handler.
  • We then ran GPT-6 Sol under OpenAI's Daybreak tier for defensive cybersecurity work. These reviews ran to the end and also found none. A stopped run is no result, and a completed run is not a complete one.
  • Opus 5.5 caught only the command backdoor, and only in the light build. That build still left cues, among them a position right next to code the agent reads anyway.
  • The full HIPC build of the same backdoor, with the same impact, was missed in every review.

hipc-fig2-results-png.81


The traces show how this happens. Almost every review saw the route that leads to the backdoor. Few followed it into the handler, fewer into the helper, and only three printed the decisive line. Those three found the backdoor. In every other review, that line was never read.

hipc-fig3-path-png.82


Asking for more did not help​

The obvious fix is a better prompt. Three of the 24 Phase 2 reviews, all by Opus 5.5 on the full HIPC build, changed only the prompt. One gave just the task, one added that no file may stay unaudited, and one also asked the agent to plan its review first and follow that plan to the end.

The reviews got longer, from 18 to 34 and 46 minutes, and wider, from 5.9% to 12.4% and 14.6% of the Go lines. All three missed the backdoor. The plan review filled its context until the client compacted it after 172 tool calls. One full context held the printed output of about a tenth of the Go code. Asking for more moved the point where the review ended, but not what it found.

What defenders can do​

None of this makes the agents useless for audits. Once they read the right line, they understood it. The weak point is that the agent decides on its own what to read. Three steps follow from our traces:
  1. Supervise the audit. Use the agent as a tool that a reviewer directs, not as an auditor that works alone. Treat the gaps it reports as open work. A long report, or a run that a safeguard stopped, says nothing about the code that was never opened.
  2. Follow dangerous calls to their callers. A search hit on a call that runs a program or grants access raises the question of who can reach it. Five of the nine reviews of the full build printed the process call at the end of the backdoor's chain, and none asked who reaches it.
  3. Enforce coverage outside the agent. A prompt cannot make one session read a whole code base when its context holds about a tenth of it. Split the code base into parts that fit, give each part to a fresh session with its file list, and merge the reports.
We have not tested whether enforced coverage closes the gap. But until an audit reports what it read as plainly as a test suite reports its coverage, a clean result describes the agent, not the code.

Everything is public​

  • The paper (PDF, 68 pages)
  • 87 run archives with the trace and the answer of every review, so every number can be checked
  • Paper and archives are licensed under CC BY 4.0
The backdoors exist only in local copies and are not released as patches. Every runtime test used synthetic accounts on a local network.

If you cite the work:
Code:
@techreport{capuano2026hipc,
  title       = {Hidden in Plain Code: Reliability and Limits of Frontier {LLMs}
                 in Detecting Software Backdoors},
  author      = {Capuano, Marco and Sabljak, Luca and Buchli, Josias},
  institution = {OST Eastern Switzerland University of Applied Sciences},
  type        = {Semester thesis},
  year        = {2026},
  month       = nov,
  note        = {Supervised by Dr. Arno Wagner}
}

Many thanks to our supervisor Dr. Arno Wagner. Questions, criticism, and replications are welcome in this thread.

The HIPC backdoors were not hidden in clever code. They were hidden in plain code that the agent chose not to read.​
 

Attachments

  • hipc-0-cover.png
    342.2 KB · Views: 15
  • hipc-fig1-reading.png
    212.2 KB · Views: 26
  • hipc-fig2-results.png
    212.3 KB · Views: 26
  • hipc-fig3-path.png
    143.7 KB · Views: 25
Back
Top