LLM Security Audit in Practice: 14 High-Severity Vulnerabilities Found in Two Weeks
This article reviews a recent real-world security audit in which a general-purpose large language model scanned nearly 6,000 C++ source files in an open-source browser project over two weeks. It examines why LLMs can detect certain cross-module logic flaws that traditional rule-based SAST tools miss, how to interpret a roughly 20% confirmation rate, and what engineering practices enterprises need to adopt the approach responsibly, including code reachability preprocessing, layered context delivery, structured output, reproducibility checks, pipeline integration, and human review.
1. Introduction: An Automated Audit Experiment That Challenges Assumptions
In traditional software security engineering, large-scale code auditing is often treated as a labor-intensive effort. A mature open-source browser project can contain millions of lines of code, with thousands of C++ source files covering highly complex subsystems such as memory management, concurrent scheduling, scripting engines, and rendering pipelines. The conventional assumption is that even after years of manual review and continuous external research, exploitable memory-corruption defects can still remain.
A recent public test challenged this assumption. A general-purpose large language model with million-token context capability and long-running autonomous execution scanned nearly 6,000 C++ source files in an open-source browser project over two weeks. It submitted 112 potential defect reports. The upstream maintainers ultimately confirmed 22 real vulnerabilities: 14 high-severity, 7 medium-severity, and 1 low-severity. Notably, the first confirmed use-after-free defect appeared about 20 minutes after the task started. Related fixes have been included in a new browser release and pushed to hundreds of millions of users.
This article does not retell a vendor narrative. Instead, it reframes the experiment as an engineering problem: why can LLMs produce findings in areas where traditional static scanning has blind spots? How should their output be measured? What must enterprises put in place before adopting this capability in their own development workflows?
2. Capability Prerequisites: What Long Context and Long Autonomous Execution Change
Two underlying capability variables explain the outcome.
First is the leap in context window size. Traditional static analysis tools operate with a local, file-by-file, function-by-function perspective. Cross-file data flows must be reconstructed through manual configuration or limited call graphs. When context capacity reaches the million-token level, a model can simultaneously “see” callers, callees, type definitions, macro expansions, and related comments within a single inference pass. Cross-module taint tracking becomes practically feasible for the first time.
Second is long-running autonomous execution. Security auditing is not a single question-answer interaction; it is a multi-round loop of hypothesis, code localization, path verification, and report writing. The model must independently decompose tasks, schedule retrievals, maintain goal consistency across rounds, and avoid losing the audit thread during extended operation. Only when these two capabilities combine does an LLM move from a “code Q&A assistant” to something capable of taking on entry-level audit work.
3. The Methodological Divide: Pattern Matching vs. Semantic Understanding
Traditional SAST tools, commonly based on rule engines, rely fundamentally on pattern matching. If told that “concatenating strings into SQL statements is dangerous,” they search for code snippets matching that syntactic shape. This approach has two inherent limits: vulnerability types not covered by the rule base remain entirely invisible; and cross-function, cross-module issues—such as race conditions and state-machine flaws that depend on business semantics—are nearly impossible to express.
The LLM approach does not query a rule base. It reads code semantics: where data enters (external input, deserialization, IPC boundaries), which validations and transformations it passes through, which sensitive operations it ultimately reaches (memory deallocation, pointer dereference, type casting, permission checks), and whether any branch along that path can break an invariant.
Schematic example of a use-after-free defect at the semantic level:
// Pseudocode: an object is freed on an error path, but the reference// is still used by subsequent logicvoid Layout::Update(Frame* frame) {RefPtr<Widget> w = frame->GetWidget();if (!w->NeedsLayout()) {frame->Discard(); // internally may destroy w}w->MarkDirty(); // w may be dangling here}
A rule engine struggles to detect the implicit coupling between Discard() and the lifetime of w. Semantic-level analysis can link the ownership-transfer/deallocation point with subsequent dereference points, then use the call chain to confirm whether a reachable trigger path actually exists. This is why cross-module logic flaws remain a blind spot for traditional tools while becoming the main strength of LLMs.
4. Reading the Test Data: Why a 20% Confirmation Rate Is Not Low
Out of 112 reports, 22 were confirmed—a confirmation rate of roughly 20%. The common first reaction is that the noise level is too high. That assessment needs correction.
First, this was raw output with no human pre-screening. Reports submitted by human security researchers to open-source projects typically have a 30%–50% confirmation rate, often after self-validation and peer discussion. A fully automated pipeline achieving 20% without filtering already delivers engineering value per unit of compute.
Second, report count and vulnerability count are different dimensions. The 112 reports included many cases of “different trigger paths for the same root cause,” “suspicious but unreachable paths,” and “issues that only hold under specific compiler options.” These findings still carry information value for maintainers. The upstream reaction is telling: initially, each finding required manual review before submission; after assessing the quality of the first few reports, maintainers switched to bulk submission and let the maintainers team handle classification. This is a typical path by which automated audit tools gain acceptance in real projects—first establish quality trust, then transfer filtering costs.
Third, consider the scale of the 14 high-severity findings. For one of the most heavily tested and longest-audited open-source projects, this represents a significant share of its annual high-severity fix volume. The defects were distributed across multiple non-adjacent subsystems—scripting engine, bytecode execution, rendering pipeline—showing that the model was not repeatedly mining a single corner but could spread horizontally and localize issues quickly. The most severe single case in the test received a near-perfect CVSS score (9.8/10), involving a memory-corruption issue triggerable without special conditions.
5. From Experiment to Production: Six Engineering Essentials for Enterprises
Simply running the model once and reviewing the report is insufficient if you want to bring this capability into your own codebase. The following engineering steps are essential.
- Code reachability preprocessing. The repository must be stably searchable and sliceable. Build scripts, dependency versions, and compiler macro configurations should all be accessible; otherwise, the model’s assessment of conditional compilation branches will be inaccurate.
- Layered context delivery. Do not feed the entire codebase at once. Organize it in layers—“entry points, call chains, type definitions, historical commits”—so the model focuses on one verifiable hypothesis per round.
- Structured output. Require the model to provide five elements for each finding: defect type, affected functions and line numbers, preconditions for triggering, data-flow path, and fix recommendation. Any finding missing one of these is considered not reviewable.
- Mandatory reproducibility verification. Every high-severity conclusion must include a minimal reproduction idea or an executable verification method (constructing an input, enabling specific check options, writing a targeted test case), reducing “looks like a vulnerability” to “can be proven.”
- Division of labor with existing pipelines. Rule-based scanning continues to provide cost-effective coverage for known patterns; semantic analysis handles cross-module logic flaws. Both feed into a unified defect management platform for deduplication, prioritization, and assignment.
- Measurement and regression. Track confirmation rate, mean time to fix, duplicate report rate, and false-positive root-cause distribution. Build iteration of prompting and retrieval strategies on data rather than intuition.
On the infrastructure side, this workflow typically requires general cloud capabilities such as code hosting and artifact storage, logging services, monitoring and alerting, and containerized compute scheduling. For specific choices and implementation, you can evaluate practices around general product categories such as container platforms, log services, and monitoring and alerting offered by Baidu AI Cloud.
6. Risks and Boundaries: Don’t Treat a Probabilistic Model as a Judge
It is essential to be clear-eyed: LLM output is probabilistic. It will confidently report defects that do not exist and miss issues requiring deep algorithmic reasoning. Its proper role is “high-recall initial screener + report drafting assistant,” not “final arbiter.” Human review of high-severity conclusions cannot be skipped. Validation involving production environments must occur in isolated settings. The scanning process itself should follow least-privilege and audit-trail principles to avoid exposing sensitive code and credentials through uncontrolled channels.
7. Conclusion
The real signal from this experiment is not “AI replaces security researchers” but a rewrite of audit economics. Previously, limited manpower allowed only sampled audits of high-risk modules. Now, thousands of files can undergo full semantic scanning within two weeks, concentrating human effort on prioritization, reproduction, and fix design. The practical next step for R&D teams is clear: pick a medium-sized, non-core codebase for a controlled pilot, establish structured output standards and reproduction-verification gates, and decide on expansion based on two metrics—confirmation rate and fix turnaround time.
