Enhancing Application Security and Finding Vulnerabilities in Software
Chris Wysopal (Founder & CTO · Veracode)
Black Hat Middle East & Africa 2023 (Executive Summit) · Day 1 · Executive Summit
Overview
In this compelling Black Hat MEA talk, Chris Wysopal, a cybersecurity veteran and Co-founder & CTO of Veracode, delves into the escalating crisis of software vulnerabilities and proposes a revolutionary approach leveraging generative artificial intelligence (AI). Wysopal, whose career spans from hacking government software with The Loft in 1998 to leading a major application security firm, paints a stark picture of an industry struggling to keep pace with the influx of insecure code. He highlights how traditional methods of finding and manually fixing vulnerabilities are failing, exacerbated by the rapid adoption of AI-driven code generation.

Key moments
- 0:00 Introduction and history of finding software vulnerabilities
- 2:30 The problem: vulnerabilities found faster than fixed
- 5:00 Generative AI trained on vulnerable open-source code
- 9:00 AI increases insecure code, creates false confidence
- 12:00 Veracode's solution: AI-powered automatic vulnerability fixing
- 15:00 Demonstrating AI autofix for cross-site scripting
- 18:30 Lessons learned: data quality, bias, IP in AI security
Enhancing Application Security and Finding Vulnerabilities in Software
Speakers: Chris Wysopal, Founder & CTO, Veracode
Conference: Black Hat MEA
YouTube: https://www.youtube.com/watch?v=NNbWZsPk9y0
Overview
In this compelling Black Hat MEA talk, Chris Wysopal, a cybersecurity veteran and Co-founder & CTO of Veracode, delves into the escalating crisis of software vulnerabilities and proposes a revolutionary approach leveraging generative artificial intelligence (AI). Wysopal, whose career spans from hacking government software with The Loft in 1998 to leading a major application security firm, paints a stark picture of an industry struggling to keep pace with the influx of insecure code. He highlights how traditional methods of finding and manually fixing vulnerabilities are failing, exacerbated by the rapid adoption of AI-driven code generation.
The core of Wysopal's presentation is a critical examination of how general-purpose generative AI, trained on vast datasets of often-vulnerable open-source code, is inadvertently introducing new security risks at an alarming rate. However, he pivots this concern into a solution: by specifically training and tuning these powerful AI models for security remediation, organizations can transform the DevSecOps pipeline. This shift promises to move beyond mere vulnerability identification to automated, intelligent code fixing, significantly reducing security debt and empowering developers to build inherently more secure applications. Wysopal's talk is not just a warning but a roadmap for harnessing AI to finally turn the tide against persistent software insecurity.
Background
▶ Watch: Introduction and history of finding software vulnerabilities (0:00)
Chris Wysopal's journey in cybersecurity is foundational to understanding the context of this talk. As a member of the legendary hacker collective The Loft, he famously testified before the US Senate in 1998, illustrating the profound insecurity of software underpinning critical government systems. This early exposure to pervasive vulnerabilities, often dismissed by vendors, shaped his career trajectory. After transitioning from a "hacker" to a security consultant in 2000, he co-founded Veracode in 2006 with Christien Rioux, aiming to address software insecurity at scale through a Software-as-a-Service (SaaS) model.
Veracode's extensive data, collected from scanning over 750,000 applications for 200 customers over 18 months, underscores the magnitude of the problem. Wysopal reveals several disturbing trends:
- Vulnerability Accumulation: Developers are introducing new vulnerabilities faster than they can fix existing ones.
- Aging Software Risks: Software quality degrades over time. While new software initially sees a spike in vulnerabilities, the rate increases significantly as applications age. By the time software is two years old, over 50% contains vulnerabilities; by five years, this figure jumps to nearly 70%.
- Codebase Growth: Applications grow exponentially, roughly doubling in size every five years, leading to more code and thus more potential vulnerabilities. A one-megabyte application in its first year can become two megabytes by year five.
This already challenging landscape was dramatically altered about a year prior to the talk with the widespread emergence of generative AI tools like OpenAI's models and GitHub Copilot. These tools, designed to boost developer productivity by generating code from natural language prompts, were primarily trained on the world's open-source codebase. Critically, this vast repository is known to harbor thousands of Common Vulnerabilities and Exposures (CVEs) annually. The immediate and obvious consequence, as Wysopal highlights, is that AI models "learned how to write software by learning how to write vulnerable software," threatening to amplify the existing security crisis by generating insecure code at unprecedented speeds.
Key Findings
▶ Watch: Generative AI trained on vulnerable open-source code (5:00)
Wysopal presents several compelling studies that quantify the security risks associated with current generative AI tools when used for code generation:
- AI-Generated Code Quality: A recent study examining 435 examples of AI-generated open-source code over the past year found that 35.8% contained vulnerabilities. This rate is comparable to, or even slightly higher than, the rate at which human developers introduce flaws. Identified vulnerability types included OS command injection, insufficiently random values, and improper checks for error handling, all of which are exploitable by attackers.
- Training Data Implications: Another study presented at Black Hat USA in 2022 explored 89 scenarios where researchers prompted the technology behind GitHub Copilot to generate code. A staggering 40.7% of the generated code contained vulnerabilities. The researchers hypothesized that this was due to the AI being trained on older open-source projects, some 5-10 years old, which incorporated outdated and insecure coding techniques. This suggests that the "knowledge base" of general LLMs might be inherently flawed from a security perspective.
- False Sense of Security: A controlled study comparing developers using generative AI chatbots with those writing code manually revealed concerning psychological effects. The group using AI wrote more insecure code than the control group. Furthermore, when surveyed, the AI-assisted developers reported higher confidence in the security of their code. This "false sense of security" is a critical concern, as it can lead developers to overlook potential flaws, believing the AI has produced robust code.
- Inaccurate Security Advice: Beyond code generation, developers often use tools like ChatGPT to ask security-related questions or seek algorithmic guidance. A study comparing ChatGPT's answers to those on Stack Overflow found that ChatGPT provided incorrect answers to 52% of the questions. Even more alarmingly, developers perceived these incorrect answers as correct 42% of the time, and expressed a preference for them 77% of the time. This highlights the risk of developers incorporating fundamentally "wrong ideas" into their software based on AI-generated advice.
These findings collectively underscore a critical point: while generative AI offers immense productivity benefits, its current general-purpose application in software development without specific security tuning poses a significant threat, potentially accelerating the introduction of vulnerabilities and fostering a dangerous overconfidence among developers.
Technical Deep Dive
▶ Watch: AI increases insecure code, creates false confidence (9:00)
Recognizing the dual nature of generative AI – a source of potential risk and immense opportunity – Veracode has focused on harnessing its power specifically for remediation. Wysopal introduces Veracode's strategic shift from merely "finding problems" to "automatically fixing those problems" within the DevSecOps lifecycle. The goal is to integrate autofixing capabilities directly into the development workflow, significantly reducing the time and effort developers spend on vulnerability remediation.
The proposed solution envisions a process where:
- Vulnerability Identification: Veracode's existing scanning tools identify flaws in the codebase.
- Automated Fix Generation: Instead of just reporting the flaw, a specialized generative AI model generates a code fix.
- Developer Review and Application: The developer receives the suggested code change, which can be easily dropped in place or copied and pasted, and then applies it. The developer remains "in the loop," ensuring oversight, but no longer needs deep expertise in fixing every specific flaw.
Wysopal illustrates this concept with a classic example: Cross-Site Scripting (XSS).
- Vulnerable Code: A line of code that directly reflects user input from a request back into the application's output without proper sanitization. If a user inputs JavaScript, it will execute in the browser.
- AI-Generated Fix: The AI identifies the vulnerable point and suggests modifying the code to include a function like
string Escape utils. This function escapes characters in the user input, rendering any injected JavaScript ineffective and preventing its execution.
The technical foundation for this autofixing capability lies in treating vulnerability remediation as a text generation problem. The primary challenge is not the generation itself, as pre-trained Transformers and large language models (LLMs) like those from OpenAI (e.g., GPT) or open-source models available on platforms like Hugging Face are highly proficient at understanding and generating code. The critical differentiator is training.
Veracode's approach involves:
- Specialized Training Data: For each programming language and vulnerability type (e.g., XSS in Java), Veracode curates dozens of examples of "bad code" (vulnerable) and corresponding "good code" (fixed).
- Fine-tuning LLMs: These examples are used for additional training on existing open-source LLMs that already possess a strong understanding of code syntax and semantics. This fine-tuning teaches the AI the specific patterns of secure coding and how to transform vulnerable code into secure code.
- Proprietary Knowledge Integration: By layering Veracode's proprietary security knowledge and vulnerability data on top of general-purpose LLMs, the system becomes highly effective at generating accurate and context-aware fixes. Wysopal emphasizes the surprising effectiveness of this approach.
This automated process drastically reduces the long, multi-month cycle of manual vulnerability remediation, which typically involves flaw discovery, triage, ticket creation, prioritization, assignment, and potentially developer training. Autofixing, by contrast, can reduce this to minutes, allowing developers to ship more secure software faster. Wysopal conservatively estimates that such a system can fix around 39% of code flaws, with some programs and languages like Java showing potential for over 70% of vulnerabilities to be automatically remediated.
Demo / Proof of Concept
▶ Watch: Demonstrating AI autofix for cross-site scripting (15:00)
While Chris Wysopal's talk did not feature a live, interactive demonstration of Veracode's autofixing solution, he effectively illustrated the concept and capabilities of the technology through detailed examples and architectural descriptions. Wysopal presented the autofixing mechanism as a developed and functional component, using specific code snippets to explain its operation.
The core of this conceptual demonstration revolved around a common Cross-Site Scripting (XSS) vulnerability. Wysopal walked the audience through:
- Vulnerable Code Identification: He showed how a traditional security scanner would flag a line of code where user input (
request.getParameter) is directly reflected into the output (response.getWriter().println(name)). This lack of sanitization allows an attacker to inject malicious JavaScript. - Automated Fix Generation: He then presented the "fixed" version of the code, demonstrating how the generative AI would introduce a security-enhancing function, specifically
string Escape utils, to neutralize the XSS vulnerability. This function would escape special characters in the user input, preventing the execution of malicious scripts. The visual comparison of the "before" and "after" code effectively conveyed the AI's ability to generate precise and contextually appropriate fixes.
Wysopal further elaborated on the user experience, describing how developers would receive these suggested fixes directly within their development environment. The idea is that the AI generates "actual code – code that can be dropped in place, copied and pasted" – requiring minimal effort from the developer to implement. This conceptual "demo" highlighted the system's ability to transform raw vulnerability findings into actionable, ready-to-use code changes, underscoring the shift from mere detection to proactive remediation. His discussion of the internal workings, such as the AI being trained on "dozens of examples of bad code and good code" for specific languages and vulnerability types, further solidified the practical implementation of the proof of concept.
Defensive Implications
▶ Watch: Lessons learned: data quality, bias, IP in AI security (18:30)
The insights presented by Chris Wysopal offer critical defensive implications for organizations grappling with application security:
- Embrace Specialized AI for Security: General-purpose generative AI tools, while powerful for productivity, are not inherently secure and can even introduce vulnerabilities. Defenders must advocate for and adopt AI solutions specifically trained and tuned for security tasks, such as Veracode's autofixing engine. This means moving beyond generic LLMs to specialized security AI that understands "good code" vs. "bad code."
- Shift Left with Automated Remediation: The traditional cycle of finding, triaging, and manually fixing vulnerabilities is unsustainable. Organizations must integrate automated vulnerability remediation into their DevSecOps pipelines. By enabling AI to generate fixes in minutes, rather than months, security teams can significantly reduce security debt and ensure more secure code ships faster. This "shift left" approach becomes truly effective when remediation is automated.
- Maintain Human Oversight and Vetting: Despite the promise of AI, human developers and security experts must remain in the loop. AI-generated fixes, while highly accurate, still require review and approval. This ensures that the fixes are contextually appropriate, do not introduce new regressions, and align with architectural standards. Wysopal explicitly states that developers are "still in the loop," even if they don't need to know how to fix every flaw.
- Prioritize Training Data Quality and Ethics: When adopting any AI-driven security solution, organizations must rigorously interrogate the provenance and quality of its training data. Key questions include:
- Data Licensing: Is the training data ethically sourced and properly licensed?
- Intellectual Property (IP) Protection: Does the training data contain proprietary customer code or other sensitive IP that could be leaked or exposed? Veracode, for example, deliberately avoided using customer code for its training.
- Accuracy and Vetting: Who vetted the output of the AI during training? How is the accuracy of the generated fixes ensured?
- Combat False Confidence and Bias: The studies highlighted by Wysopal reveal a dangerous tendency for developers to feel overconfident in AI-generated code and to accept incorrect AI advice. Security awareness programs must educate developers about the limitations of AI and the importance of critical thinking and validation, even when using advanced tools. Expert review and validation are crucial to counteract human bias towards AI.
- Re-evaluate Developer Training: The rise of autofixing tools sparks a provocative question: do developers still need extensive training on how to fix every type of flaw, or can they rely on AI to provide the correct code change? While fundamental secure coding principles remain vital, the focus of training might shift from rote memorization of fixes to understanding security concepts and critically evaluating AI-generated solutions.
By strategically adopting specialized AI, integrating automated remediation, maintaining human oversight, and being diligent about training data, organizations can transform their application security posture from reactive to proactive, building more resilient software in the face of ever-increasing threats.
Key Takeaways
- Software vulnerabilities are escalating, with over 50% of applications aged two years or more containing flaws, and manual remediation efforts proving insufficient to keep pace.
- General-purpose generative AI, trained on vast open-source codebases, frequently introduces new vulnerabilities (e.g., 35.8% to 40.7% of AI-generated code in studies) and can foster a dangerous "false sense of security" among developers.
- Specialized, security-tuned generative AI can transform DevSecOps by automating vulnerability autofixing, significantly reducing the months-long remediation cycle to minutes and potentially fixing over 70% of flaws in some contexts.
- The effectiveness and safety of AI-driven security solutions depend critically on the quality, ethical sourcing, and vetting of their training data, including strict measures to protect intellectual property.
- Human oversight remains paramount; developers must stay "in the loop" to review and apply AI-generated fixes, and security teams must counteract human biases and false confidence associated with AI usage.
About the Speaker(s)
Chris Wysopal is a highly respected figure in the cybersecurity industry, known for his pioneering work and long-standing commitment to improving software security. He is the Co-founder and Chief Technology Officer (CTO) of Veracode, a leading provider of application security solutions.
Wysopal's career began famously as a member of The Loft, a prominent hacker collective. In 1998, he testified before the US Senate, highlighting the pervasive software vulnerabilities that affected government systems. This pivotal moment underscored his early recognition of the systemic issues in software development. After transitioning from a "hacker" to a security consultant in 2000, he co-founded Veracode in 2006 with Christien Rioux. At Veracode, he has been instrumental in developing scalable solutions to find and fix vulnerabilities in software, leveraging extensive data to understand and address the industry's security challenges. His expertise spans from deep technical understanding of software flaws to strategic insights into the future of application security, particularly with the advent of generative AI.
Reviews
Dr. Zero (Offensive Security Researcher) — WEAK
Wysopal is a L0pht legend, but this talk is just a thinly veiled pitch for Veracode's AI autofixing product. Reciting a year's worth of academic papers on why GitHub Copilot writes garbage code doesn't make your fine-tuned LLM a research breakthrough. No live demo and a conceptual XSS fix make this a vendor briefing, not a Black Hat technical session.
Heather Calloway (CISO) — SOLID
Wysopal correctly identifies the governance nightmare of developer-led AI adoption: faster code generation means faster vulnerability accumulation coupled with dangerous false confidence. However, the proposed solution is ultimately a pitch for Veracode's autofix product. It is worth pulling his metrics for your next IT steering committee, but you can skip the vendor showcase.
→ Top-rated talks at Black Hat Middle East & Africa 2023 (Executive Summit)
All talks from Black Hat Middle East & Africa 2023 (Executive Summit)