HabrAugust 18, 2026🇷🇺Translated from Russian

Study Finds Iterative AI Code Generation Accumulates Security Vulnerabilities Over Multiple Iterations

A new study presented at IEEE-ISTAS 2025 demonstrates that iterative prompting of large language models for code generation causes progressive degradation of security properties.

Researchers began with 10 secure, vulnerability-free code samples written in C and Java. They then applied four distinct prompting strategies—adding features, optimizing performance, explicitly improving security, and using vague “make it better” requests—across 10 successive iterations, producing 400 code variants that were examined both manually and with automated scanners.

Key Findings on Vulnerability Accumulation

The number of vulnerabilities increased nonlinearly with each iteration. Prompts focused on adding functionality generated the highest total (158 vulnerabilities), while security-oriented prompts produced the lowest count (38). Nevertheless, even security-focused requests often replaced obvious flaws with more subtle ones.

A statistically significant positive correlation (r = 0.64) was observed between code complexity growth and vulnerability count. For every 10 % increase in complexity, researchers recorded an average 14.3 % rise in vulnerabilities.

Concrete Examples of Degradation

  • Memory-management functions evolved from safe allocation routines into complex pointer arithmetic containing buffer-overflow and use-after-free risks by iteration 10.
  • Authentication token checks acquired timing side-channels, parsing vulnerabilities, and flawed multi-factor recovery logic.
  • Database access routines lost parameterization, introduced dynamic string concatenation, and later added transaction support that created race conditions.

Although 27 % of early security-oriented iterations (iterations 1–3) produced genuine improvements such as added input validation and NULL checks, these gains were typically offset by new hidden vulnerabilities in later rounds.

Recommendations and Limitations

The authors conclude that human oversight after every iteration—or at minimum after no more than three iterations—is essential. They also advise increased reliance on static application security testing (SAST) tools whenever code volume grows substantially.

The study tested only GPT-4o and did not allow human corrections during the iterative process, leaving open questions about whether newer models exhibit the same pattern at later iteration counts.

Related articles

BoletimSecAI Security

Cybercriminals Deploy Advanced AI for Continuous Automated Reconnaissance and Exploitation at Scale

Advanced AI models now enable cybercriminal groups to maintain uninterrupted reconnaissance across enterprises in every sector, mapping domains, exposed services, and infrastructure changes at a pace no human team could sustain for weeks. The automated process targets two opposite profiles of vulnerable systems: legacy environments left unpatched for years with outdated versions and forgotten permissions, and rapidly deployed applications built through Vibe Coding that reach production without security review. The entire attack chain—reconnaissance, vulnerability identification, validation, and exploitation—is now executed by AI agents operating with minimal human oversight. What previously required a dedicated specialized team focused on one target at a time now runs in parallel against thousands of targets simultaneously, with marginal cost approaching zero for each additional attack. This collapse in operational costs and rise in success rates has restructured the cybercrime economy, funding increasingly sophisticated tools and lowering the barrier for new operators who need only platform access rather than deep technical expertise. The time window between an application reaching production and discovery by attackers has shrunk to hours, while most organizations still treat security as a finite project rather than an ongoing process.

安全客AI Security

Ruishu Information Warns Machine Traffic Now Dominates Internet as AI Agents Surge

Ruishu Information has released its 2026 Automation Threat Report covering data from early 2025 through Q2 2026. The report shows bots accounting for 68 percent of total internet traffic, with malicious bots making up 55 percent of that volume. Human traffic has fallen to just 22 percent while AI Agent-driven requests have grown from under 1 percent to 8-12 percent. LLM and AI Agent requests have already exceeded 450 billion, marking more than 400 percent year-over-year growth. The report introduces a new classification of non-human traffic into traditional bots, AI-enhanced bots, and autonomous AI Agents, along with an L1-L5 threat framework. It also expands documented attack scenarios from nine to thirteen, adding LLM application attacks, agent supply-chain attacks, identity hijacking, and autonomous AI-orchestrated attacks.

安全客AI Security

360 Launches nanoWork Enterprise Edition Channel Ecosystem with Native Security for AI Agents

On August 17, 360 held its nanoWork Enterprise Edition partner recruitment launch event, gathering over 200 channel partners from across China. The event marks the first major channel gathering since the product's official release on July 28. 360 founder Zhou Hongyi emphasized that AI is moving from answering questions to completing tasks, requiring robust security foundations, channel networks, and service systems. General Manager Wang Yi highlighted the low enterprise AI adoption rate of around 18% and positioned nanoWork as a secure, enterprise-grade AI agent platform built on 20 years of 360 security expertise. The company unveiled a three-dimensional partner architecture, four revenue models, and five empowerment systems to enable lightweight partner entry into the market. With a 1,000+ FDE engineer network and the AikerWorld community, nanoWork aims to deliver on-site陪跑 and service packages to bridge the last mile of AI deployment.

HabrAI Security

Reversing MD5 Hash Function from 2500-Layer Neural Network in Jane Street CTF Puzzle

A Jane Street machine learning puzzle challenged participants to reverse-engineer a PyTorch model containing 2500 layers and recover an MD5 computation solely from its integer weights. The network output 0 for nearly all inputs, forcing solvers to use mechanistic interpretability instead of gradient-based search. Alex, a graduating student, identified that the final layers performed equality checks on 16-byte values using ReLU activations and crafted linear programming and SAT reductions to simplify the model from two million nodes to 75 thousand. Further analysis revealed the core computation consisted of 32 identical MD5 rounds, with an unintended bug in length encoding for inputs exceeding 32 bytes. The hidden target hash was deliberately chosen to be brute-forceable once the algorithm was identified, and the correct input turned out to be two common English words separated by a space. The exercise demonstrated both the feasibility and the extreme difficulty of extracting algorithmic behavior from large, non-differentiable neural networks.