Skip to content
StackPoint AI
HomeServicesProductsAboutContact
Sign inStart a project ↗
Loading articles page

Have a useful problem? Let’s engineer the system.

Bring us the workflow, product idea, or business problem you want to solve.

Start a conversation ↗
StackPoint AI

Applied AI and software engineering
for dependable business systems.

ExploreHomeServicesArticlesNews
CompanyPrivacyTermsAboutApproachProducts
ConnectContactEmail usstackpointai.com

© 2026 StackPoint AI Systems Inc. All rights reserved.

Back to top ↑
Article

Understanding AI Code Vulnerabilities: Insights from Theori's Findings

A comprehensive analysis of AI-generated code vulnerabilities, focusing on findings from Theori's pentesting of applications built with AI coding agents.

Back to articles
Understanding AI Code Vulnerabilities: Insights from Theori's Findings

Executive Summary

The integration of AI coding agents into software development has transformed the landscape of application creation, but it also introduces unique security vulnerabilities. A recent study by Theori examined 28 applications built using AI models from Anthropic and OpenAI. Contrary to expectations, traditional vulnerabilities such as SQL injection and cross-site scripting were less prevalent. Instead, the study revealed a troubling trend: resource exhaustion and secrets exposure were among the most critical vulnerabilities identified.

Executive Context

Theori's research aimed to evaluate the security posture of applications developed with AI coding agents. The applications varied in their creation methods, ranging from detailed specifications to casual prompts and even legacy code rewrites. The findings challenge preconceived notions about the types of vulnerabilities that AI-generated code may harbor.

Adversary Goals and Capabilities

Understanding the motivations behind exploiting AI-generated code is crucial. Adversaries may aim to:

  • Access sensitive data through hardcoded secrets.
  • Disrupt services via resource exhaustion attacks.
  • Manipulate application behavior through access control vulnerabilities.

As AI models become more sophisticated, their ability to generate code that inadvertently contains vulnerabilities increases. This necessitates a reevaluation of security strategies to address the unique challenges posed by AI-generated applications.

Observable Indicators and Telemetry

The study identified several key indicators of vulnerabilities within AI-generated applications:

  • Resource Exhaustion: Found in 21% of the applications, these vulnerabilities stem from unbounded pagination, lack of rate limiting, and synchronous processing that can lead to denial-of-service conditions.
  • Secrets Exposure: Nearly half of the critical findings involved hardcoded secrets, such as API keys and JWT secrets, often found in quick-start templates.
  • Access Control Issues: Insecure direct object references (IDOR) were notably present, particularly in larger applications where oversight can lead to data breaches.

These indicators highlight the need for continuous monitoring and auditing of AI-generated code to mitigate potential risks.

Incident Response Priorities

Organizations must prioritize their incident response strategies to address the vulnerabilities associated with AI-generated code:

  1. Automated Code Review: Implement automated tools to conduct line-by-line reviews of AI-generated code, focusing on identifying security vulnerabilities.
  2. Human Oversight: Maintain human involvement in reviewing threat models and high-level architecture to ensure comprehensive security assessments.
  3. Continuous Monitoring: Establish a framework for ongoing monitoring of applications to detect and respond to emerging vulnerabilities.

Andrew Wesie, CTO at Theori, emphasizes the importance of combining automated tools with human judgment:

“Humans should still drive the review that matters: threat models, high-level architecture, and product decisions.”

Strategic Impact for Leadership

For organizational leaders, the findings from Theori's study underscore the need for a proactive approach to cybersecurity in the age of AI:

  • Investment in Security Tools: Allocate resources towards advanced security tools that can effectively analyze AI-generated code.
  • Training and Awareness: Educate development teams about the unique vulnerabilities associated with AI coding agents.
  • Collaboration with AI Developers: Engage with AI model developers to understand the limitations and potential risks of their technologies.

By prioritizing these strategies, organizations can better safeguard their applications against the evolving threat landscape.

Sources

  • The AI code vulnerabilities that grow with your app
  • OpenAI: Our models breached Hugging Face during a cyber capability test

A comprehensive analysis of AI-generated code vulnerabilities, focusing on findings from Theori's pentesting of applications built with AI coding agents.

coding agents. The applications varied in their creation methods, ranging from detailed specifications to casual prompts and even legacy code rewrites. The findings challenge preconceived notions about the types of vulnerabilities that AI-generated code may harbor. Adversary Goals and Capabilities Understanding the motivations behind exploiting AI-generated code is crucial. Adversaries may aim to: Access sensitive data through hardcoded secrets. Disrupt services via resource exhaustion attacks. Manipulate application behavior through access control vulnerabilities. As AI models become more sophisticated, their ability to generate code that inadvertently contains vulnerabilities increases. This necessitates

This report consolidates available public details and highlights where evidence is still limited, helping teams prioritize immediate defensive action while additional technical indicators are collected.

a reevaluation of security strategies to address the unique challenges posed by AI-generated applications. Observable Indicators and Telemetry The study identified several key indicators of vulnerabilities within AI-generated applications: Resource Exhaustion: Found in 21% of the applications, these vulnerabilities stem from unbounded pagination, lack of rate limiting, and synchronous processing that can lead to denial-of-service conditions. Secrets Exposure: Nearly half of the critical findings involved hardcoded secrets, such as API keys and JWT secrets, often found in quick-start templates. Access Control Issues: Insecure direct object references (IDOR) were notably present,

particularly in larger applications where oversight can lead to data breaches. These indicators highlight the need for continuous monitoring and auditing of AI-generated code to mitigate potential risks. Incident Response Priorities Organizations must prioritize their incident response strategies to address the vulnerabilities associated with AI-generated code: Automated Code Review: Implement automated tools to conduct line-by-line reviews of AI-generated code, focusing on identifying security vulnerabilities. Human Oversight: Maintain human involvement in reviewing threat models and high-level architecture to ensure comprehensive security assessments. Continuous Monitoring: Establish a framework for ongoing monitoring of

Based on observed patterns in recent campaigns, the likely attacker objective is to establish durable access, exploit trust relationships, and later pivot toward higher-value systems. Where specific attribution or tooling data is absent, these details are not publicly disclosed and should be treated as unknown.

applications to detect and respond to emerging vulnerabilities. Andrew Wesie, CTO at Theori, emphasizes the importance of combining automated tools with human judgment: “Humans should still drive the review that matters: threat models, high-level architecture, and product decisions.” Strategic Impact for Leadership For organizational leaders, the findings from Theori's study underscore the need for a proactive approach to cybersecurity in the age of AI: Investment in Security Tools: Allocate resources towards advanced security tools that can effectively analyze AI-generated code. Training and Awareness: Educate development teams about the unique vulnerabilities

associated with AI coding agents. Collaboration with AI Developers: Engage with AI model developers to understand the limitations and potential risks of their technologies. By prioritizing these strategies, organizations can better safeguard their applications against the evolving threat landscape. Sources The AI code vulnerabilities that grow with your app OpenAI: Our models breached Hugging Face during a cyber capability test Theori built 28 apps with AI coding agents and scanned each one through its pentesting platform. Five models did the building, split between Anthropic and OpenAI, across apps written from

a spec, thrown together from a casual prompt, and rewritten from an aging PHP codebase. The team went in expecting injection everywhere. SQL injection, cross-site scripting, the bugs that fill security tutorials. Those barely showed up. The models reached for prepared statements and ORMs on … More → The post The AI code vulnerabilities that grow with your app appeared first on Help Net Security . to what the easy bugs have in common. “Frontier models understand well-documented vulnerability classes better, but those vulnerability classes also are simpler and require

Security engineering teams should validate exploitability across environments, map exposure by asset criticality, and confirm whether available telemetry can detect pre-compromise reconnaissance, exploitation attempts, and post-exploitation behavior.

less context to identify and fix,” he told Help Net Security. A single line of code shows the flaw, and a single line of code fixes it. Resource exhaustion and denial-of-service problems were the most common flaw at 21% of findings. Unbounded pagination. No rate limits. Synchronous work that blocks the whole process. These showed up in nearly every project. The impact lands in operation. A This report consolidates available public details and highlights where evidence is still limited, helping teams prioritize immediate defensive action while additional technical indicators are

Organizations with internet-facing systems, third-party integrations, or delayed patch cycles generally carry elevated risk. Internal segmentation gaps can increase blast radius if an attacker obtains initial foothold credentials.

Detection and Monitoring Priorities

  • Correlate authentication anomalies with unusual process execution and outbound traffic spikes.
  • Alert on privilege escalation events, lateral movement indicators, and unauthorized persistence changes.
  • Prioritize monitoring of externally exposed services and high-value identity providers.
  • Track integrity changes in scripts, scheduled tasks, startup items, and critical configuration files.
  • Hunt for command-and-control beaconing patterns and suspicious use of remote administration tools.

Detection coverage should be validated through tabletop simulation or controlled testing to ensure response teams receive actionable, high-confidence alerts quickly.

Mitigation Checklist

  • Patch affected services and validate version levels across all environments.
  • Restrict exposed management and service ports to trusted networks only.
  • Enable detailed logging and alerting for suspicious process or network activity.
  • Harden endpoint controls and isolate high-risk systems until remediation completes.
  • Conduct post-remediation validation and document residual risk.

Mitigations should be sequenced by risk: immediately reduce exposed attack surface, then remove persistence opportunities, and finally harden architecture to prevent recurrence.

Incident Response and Recovery Planning

  1. Establish a clear incident commander and communication cadence across security, IT, and leadership.
  2. Capture and preserve relevant logs and forensic artifacts before major containment changes.
  3. Contain compromised accounts and hosts, then execute structured eradication with validation checkpoints.
  4. Document lessons learned and implement control improvements with owner accountability and timelines.

Recovery should include business continuity planning, legal or regulatory assessment where required, and transparent stakeholder updates based on verified facts.

collected. server runs up a large bill, or an attacker knocks it over. Wesie puts these in the category models still miss. “The vulnerability classes that models still struggle with are those that require system-level understanding,” he said. “Resource exhaustion types of vulnerabilities require understanding the limits of the system: how many requests per second is it expected to handle.” The model has to know how many requests the service should take and how big an uploaded file can get, and often that number lives nowhere in the code. Secrets

exposure produced close to half of the critical findings. Hardcoded keys, default SECRET_KEY values, JWT secrets that let an attacker forge a session. These sit in quick-start templates that fill the training data and survive any “does it work” check. Access-control bugs told a story about size. IDOR, where a user reaches data beyond their permissions, made up 11% of findings in the small builds. The rewritten CMS hit 28%. The same-user ownership check is local and easy. The rule that spans hundreds of endpoints in a large app leaves

Security leaders should align technical remediation with stakeholder communication, incident readiness, and continuous monitoring to reduce repeat exposure.

Related Reading

More articles

Mixpanel Security Breach: Understanding the Risks and ResponsesMixpanel has reported a security breach due to a vulnerability in third-party software, impacting customer data and raising concerns about cybersecurity practices.FBI Warns of Autonomous AI-Driven Cyber Attacks on Critical InfrastructureThe FBI has issued a warning about the use of autonomous AI frameworks by hackers targeting government and critical infrastructure organizations, emphasizing the need for heightened cybersecurity measures.Navigating Cybersecurity in the Age of AI: Challenges and SolutionsExplore the evolving landscape of cybersecurity as AI technologies expand the attack surface, highlighting key vulnerabilities and offering actionable remediation strategies.
View more articles