Wanneer "Correct" Niet Veilig Is: Kunnen We Functioneel Correcte Patches Vertrouwen die door Code-Agents zijn gegenereerd?
When "Correct" Is Not Safe: Can We Trust Functionally Correct Patches Generated by Code Agents?
October 15, 2025
Auteurs: Yibo Peng, James Song, Lei Li, Xinyu Yang, Mihai Christodorescu, Ravi Mangal, Corina Pasareanu, Haizhong Zheng, Beidi Chen
cs.AI
Samenvatting
Code agents worden steeds vaker vertrouwd om zelfstandig bugs te repareren op platforms zoals GitHub, maar hun beveiligingsevaluatie richt zich bijna uitsluitend op functionele correctheid. In dit artikel onthullen we een nieuw type bedreiging voor code agents in de praktijk: Functioneel Correct maar Kwetsbare (FCV) patches, die alle testgevallen doorstaan maar kwetsbare code bevatten. Met onze voorgestelde FCV-Aanval, die opzettelijk kan worden gecreëerd door kwaadwillende aanvallers of onbewust kan worden geïntroduceerd door welwillende ontwikkelaars, tonen we aan dat state-of-the-art LLM's (bijv. ChatGPT en Claude) en agent-scaffolds (bijv. SWE-agent en OpenHands) allemaal kwetsbaar zijn voor deze FCV-bedreiging; over 12 agent-modelcombinaties op SWE-Bench vereist de aanval slechts black-box toegang en een enkele query naar de code agent om de aanval uit te voeren. Voor CWE-538 (informatieblootstellingskwetsbaarheid) behaalt de FCV-Aanval bijvoorbeeld een aanvalssuccespercentage van 40,7% op GPT-5 Mini + OpenHands. Onze resultaten onthullen een belangrijke beveiligingsbedreiging die over het hoofd wordt gezien door huidige evaluatieparadigma's en benadrukken de noodzaak van de ontwikkeling van beveiligingsbewuste verdedigingsmechanismen voor code agents.
English
Code agents are increasingly trusted to autonomously fix bugs on platforms
such as GitHub, yet their security evaluation focuses almost exclusively on
functional correctness. In this paper, we reveal a novel type of threat to
real-world code agents: Functionally Correct yet Vulnerable (FCV) patches,
which pass all test cases but contain vulnerable code. With our proposed
FCV-Attack, which can be deliberately crafted by malicious attackers or
implicitly introduced by benign developers, we show that SOTA LLMs (e.g.,
ChatGPT and Claude) and agent scaffolds (e.g., SWE-agent and OpenHands) are all
vulnerable to this FCV threat; across 12 agent-model combinations on SWE-Bench,
the attack only requires black-box access and a single query to the code agent
to perform the attack. For example, for CWE-538 (information exposure
vulnerability), the FCV-Attack attains an attack success rate of 40.7% on
GPT-5 Mini + OpenHands. Our results reveal an important security threat
overlooked by current evaluation paradigms and urge the development of
security-aware defenses for code agents.