Skip to content

Fixing Broken Access Control in Web Applications with LLMs: An Empirical Benchmark StudyRepairing Broken Access Control in Web Applications with LLMs: An Empirical Benchmark Study

arXiv· arXiv:2610.34290· Mingrui Liu, Liang He, Xinchu Wang, Yeting Li, Dongxu Han, Yunpeng Li, Yuling LiuInstitute of Information Engineering, Chinese Academy of Sciences; Institute of Software, Chinese Academy of SciencesIndexed by this site · 28 days ago· Originally publishedEvaluation

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

The authors built BAC-Bench (46 real BAC vulnerabilities) to evaluate 8 base LLMs and 2 agents: single-turn average repair was 37.68%, and after adding two scaffolds it reached 66.03%.

Questions
Broken Access Control (BAC) is the top-ranked Web application risk in OWASP, but it is a logic vulnerability that traditional automated repair methods struggle to handle, and previously there was no standardized BAC repair benchmark, making it impossible to fairly study and compare LLM repair capabilities.
Methods
Built BAC-Bench: 46 real BAC vulnerabilities from 6 web applications in 4 languages, each with a sandbox environment, a PoC verifier and a functional test program; proposed a four-dimension repair strategy framework of Position/Coverage/Mechanism/Content; designed two lightweight scaffolds, Apply-Feedback and Navigate-and-Locate.
Experiments and results
A single round of the base LLM fixed an average of 37.68%, the two agents averaged 77.90%; the two scaffolds raised the base LLM average to 66.03%, and Claude Opus 4.8 reached 75.36%. The Content dimension had the highest failure rate (23.44%). The authors said some LLM patches were better than the official patches, and one incidentally fixed a zero-day vulnerability that had lain dormant for three years.
Limitations and future work
The authors noted that the benchmark covers only 6 applications and 4 languages, so the conclusions may not generalize; the four-dimension labeling uses a coarse binary scheme; most vulnerabilities were disclosed around 2022 and may have entered training corpora. Future directions are inferring access control policies from source code and refining the framework.
Experimental setupClaude Code (Opus 4.8)、Codex (GPT-5.5) et al. · BAC-Bench · 修复有效率(effective patch 比例)、Applicability et al.
Threat model
Studies the ability of LLMs to automatically repair Broken Access Control (BAC) vulnerabilities in Web applications; this is not an attack paper. The input is the vulnerability description, a textual PoC description (no PoC code), and the source code; the evaluation system is offline and session-isolated, and patches are dynamically judged by a PoC verification program and a functional test program in a sandbox.
Evaluated models
Claude Code (Opus 4.8)Codex (GPT-5.5)DeepSeek-V4 ProQwen3.7-MaxClaude Opus 4.8GPT-5.5Gemini 3.5 FlashGLM-5.2MiMo-V2.5 ProKimi K2.7-Code
Benchmarks
BAC-Bench
Metrics
修复有效率(effective patch 比例)ApplicabilityPoC 通过率Functional 通过率四维失败率(Position/Coverage/Mechanism/Content)Cohen's κ
AI summaryThe researchers built BAC-Bench, the first benchmark for studying the ability of LLMs to fix broken access control (BAC) vulnerabilities in web applications. The benchmark contains 46 real vulnerabilities from 6 widely used web applications, covering 4 programming languages, each with a sandbox runtime environment, a PoC verification program, and a functional test program. Evaluation of 8 base LLMs and 2 commercial LLM agents shows that single-turn base LLMs fix an average of 37.68% of vulnerabilities; with two minimal scaffolds, Apply-Feedback and Navigate-and-Locate, the average rises to 66.03%, with the best base LLM reaching 75.36%, close to the best agent's 78.99%. The study also proposes a framework characterizing BAC patch repair strategies along four dimensions—Position, Coverage, Mechanism, and Content—and finds that some LLM-generated patches are better than the official patches, one of which incidentally fixed a zero-day vulnerability that had been latent for three years.

The researchers built BAC-Bench, the first benchmark for studying the ability of LLMs to fix broken access control (BAC) vulnerabilities in web applications. The benchmark contains 46 real vulnerabilities from 6 widely used web applications, covering 4 programming languages, each with a sandbox runtime environment, a PoC verification program, and a functional test program. Evaluation of 8 base LLMs and 2 commercial LLM agents shows that single-turn base LLMs fix an average of 37.68% of vulnerabilities; with two minimal scaffolds, Apply-Feedback and Navigate-and-Locate, the average rises to 66.03%, with the best base LLM reaching 75.36%, close to the best agent's 78.99%. The study also proposes a framework characterizing BAC patch repair strategies along four dimensions—Position, Coverage, Mechanism, and Content—and finds that some LLM-generated patches are better than the official patches, one of which incidentally fixed a zero-day vulnerability that had been latent for three years.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    BAC automated repair lacks a standard benchmark, so the authors build BAC-Bench to evaluate the ability of LLMs to repair BAC vulnerabilities in Web applications.

    Core question: How effective are LLMs at repairing Broken Access Control (BAC) vulnerabilities in Web applications, which previously could not be systematically studied due to the lack of a standardized repair benchmark.

    • Problem scenario and importance: the authors cite a report stating that CWE-862 rose from 9th to 4th in the MITRE 2025 CWE Top 25, and OWASP lists BAC as the top risk for Web applications and APIs; in December 2024, the Irish Data Protection Commission fined Meta 251 million euros for access control design flaws. The authors state that the growth in vulnerability disclosures has overwhelmed manual repair.
    • Shortcomings of existing methods: the authors state that traditional repair tools (FixMeUp, LogicPatcher, DRacv) only handle missing checks, rely on fixed templates, and target traditional architectures; BAC is a logic vulnerability with no fixed syntactic form or traceable data flow, and the target access control policy is usually undocumented, so pattern-based methods cannot be transferred.
    • Core observation: the authors believe that LLMs have internalized RBAC/ABAC/DAC and their implementation approaches during pretraining and can infer implicit authorization intent from business logic, which corresponds exactly to the three difficulties of BAC repair.
    • What the paper proposes: build BAC-Bench (46 real BAC vulnerabilities, 6 applications, 4 languages, each vulnerability with a sandbox environment, a PoC verification program, and a functional test program); propose a Position/Coverage/Mechanism/Content four-dimensional repair strategy framework; evaluate 8 base LLMs and 2 commercial LLM agents, and design two scaffolds, Apply-Feedback and Navigate-and-Locate.
    • Task setting: evaluation is a white-box scenario—the model receives the vulnerability description, a textual PoC description (no PoC code), and the source code; the system is offline to prevent obtaining official patches; patch effectiveness is determined by dynamic testing in a sandbox (§4.3).
  2. What related research exists?

    Related work is divided into three groups: BAC detection, BAC repair, and LLM automated program repair; the authors state that BAC repair research is scarce and its paradigm is single.

    BAC detection

    • White-box detection: AutoISES infers security specifications from code and flags violations; Sun et al. infer the access each role should have from the program; RoleCast locates missing checks when the check form is unknown; MACE extracts authorization context from database operations; BolaRay detects object-level violations. The authors state that detection granularity has been refined from function level to object level.
    • Black-box detection: AuthScope uses differential response analysis to find authorization vulnerabilities; BACScan introduces a feedback-driven oracle to simultaneously detect unauthorized reads and writes; BACFuzz observes SQL-layer behavior during fuzzing.

    BAC repair

    • FixMeUp (2013) mines access control templates from PHP applications and inserts missing checks, but relies on developers to manually annotate sensitive operations; LogicPatcher (2016) uses path profiling to place patches; DRacv (2025) targets PHP and Java and deploys patches as standalone guard files.
    • ACFix (2025) mines common RBAC practices from smart contracts to guide LLMs in repairing access control vulnerabilities; the paper notes that Web applications lack standardized mechanisms such as msg.sender and onlyOwner, so this paradigm cannot be directly transferred.
    • The paper notes a common shortcoming of these works: the repair mode is single (almost all reduce to inserting missing checks), and they target traditional architectures, with unclear applicability to modern Web applications.

    LLM automated program repair

    • Neural machine translation stage: SequenceR and CURE target general defects, VRepair and VulRepair target security vulnerabilities; LLM stage: AlphaRepair performs cloze-style repair, Pearce et al. systematically examine zero-shot vulnerability repair, and ChatRepair iterates patches through multi-turn dialogue.
    • Repository-level repair: SWE-bench raises the task to repository level; SWE-agent, AutoCodeRover, and Agentless are representative agents; in the security direction there are PatchAgent (the authors relay that it fixed more than 90% of 178 real vulnerabilities) and APPATCH (assumes the vulnerability location is known).

    Baselines and benchmarks: This paper does not conduct experimental comparisons with the above repair tools; the comparison is with the official patches for the same vulnerabilities (RQ4), and the evaluation benchmark is the authors' self-built BAC-Bench. The authors position the distinction of this paper: prior LLM repair research targeted memory safety vulnerabilities or smart contracts, and LLM repair of Web application BAC has been largely unexplored due to the lack of a benchmark.

  3. How does the paper address this problem?

    Build BAC-Bench with dynamic verification, define the formal conditions for repair, analyze patches with a four-dimensional framework, and design two scaffolds.

    Overall approach: first formalize the BAC repair task, then build BAC-Bench with sandbox dynamic verification, evaluate base LLMs and agents in a unified isolated environment, dissect the causes of patch failures with the BAC repair strategy framework, and mitigate the two observed types of failure with two scaffolds.

    Task formalization (§2.2)

    • Let the application be W and the request space be Q; the expected policy P and the decision implemented by the code Pimpl are both Q → {allow, deny}; the vulnerability set Vuln(W) is the set of requests that the policy denies but the code allows.
    • An effective patch must satisfy two conditions: Closure (deny all exploit requests corresponding to the vulnerability description d) and Preservation (introduce no new denials of legitimate requests, i.e., Over(W_π) ⊆ Over(W)).

    BAC-Bench construction (§4.1)

    • Vulnerability sources: BAC vulnerabilities publicly disclosed in prior research (Huang et al., BACFuzz) plus CVE database searches (disclosed in 2017 or later, GitHub open-source projects, with official patches, records containing specified authorization-related keywords), manually deduplicated and filtered to obtain 46 vulnerabilities.
    • Applications and languages: OpenEMR, Usememos, Apache InLong, BookWyrm, XWiki, Nextcloud Server, 6 applications in total, covering PHP, Java, Go, and Python (Table 1).
    • Supporting artifacts: each vulnerability is accompanied by a vulnerability description, a textual PoC description (no PoC code), the official patch and source files, a Docker sandbox environment, a PoC verification program, and a functional test program; the latter two are written by security experts with LLM assistance and verified by dynamic execution (the PoC confirms triggering the vulnerability on the unpatched application, and the functional test confirms passing).

    Verification oracle (§4.2)

    • Unauthorized read: a high-entropy, unguessable unique marker (honeytoken) is pre-placed in the victim's protected resource, and the assertion is that the attacker's response contains this marker byte for byte.
    • Unauthorized write: the primary oracle is a database state check, supplemented by a victim-side re-read through the application's own interface.
    • Functionality preservation: tests are written for the functionality involved in the vulnerability, asserting that legitimate subjects can still complete legitimate operations before and after the patch; the project's own tests are also run when present.
    • Replayability: destructive PoCs are designed to be self-contained, creating data before execution and restoring it before exit, ensuring independence from execution order.

    Evaluation setup and the two scaffolds (§4.3)

    • Base LLMs generate patches in a single turn, with input limited to the source files modified by the official patch; the two agents (Claude Code, Codex) run their multi-turn loops as-is and autonomously read the entire repository; each (model, vulnerability) pair is independently repeated 3 times.
    • Apply-Feedback (Algorithm 1): checks patch applicability with git apply --check (or --recount --check), feeds diagnostics back to the model for revision, with a self-healing budget of K=5 (at most K+1 calls).
    • Navigate-and-Locate (Algorithm 2): first provides the repository directory tree, the model requests source files as needed, with an exploration budget of M=10 rounds; if no patch has been produced, it finally requests a repair patch once; the two can be combined, allowing base LLMs and agents to be compared under the same input.

    Four-dimensional repair strategy framework (§4.4)

    • Position: the location of the checkpoint among the five layers of presentation/control/business/data/cross-cutting authorization, which must be on the vulnerability execution path and at a timing that can constrain sensitive operations.
    • Coverage: k/n, where n is the number of manually frozen vulnerability units (only the attack paths explicitly recorded in the vulnerability description; Appendix C gives the n value for each vulnerability), and k is the number of units subjected to structural security intervention.
    • Mechanism: reuse of standard mechanisms and reliable project-native mechanisms (judged successful); fragile substitute mechanisms and mechanism implementation failures (judged failed).
    • Content: correct/partially correct/incorrect, with only "correct" counted as successful under the binary mapping; annotation is performed by an LLM according to the coding rules in Table 3, with blind-label review by three PhD students in security on a stratified sample.
  4. What experiments did the paper conduct?

    The 8 base LLMs repair 37.68% on average in a single turn, and the two agents average 77.90%; the two scaffolds raise the base LLM average to 66.03%.

    Experimental setup

    • Systems under test: 8 base LLMs (DeepSeek-V4 Pro, Qwen3.7-Max, Claude Opus 4.8, GPT-5.5, Gemini 3.5 Flash, GLM-5.2, MiMo-V2.5 Pro, Kimi K2.7-Code) and 2 commercial closed-source LLM agents (Claude Code 2.1.160, Codex 0.139.0), see Table 2.
    • Benchmark: BAC-Bench, 46 real BAC vulnerabilities from 6 applications and 4 languages.
    • Metric: proportion of effective patches—must apply successfully, compile (when applicable), pass the PoC test, and pass the functional test (Table 4 note); three staged metrics are also reported: Applicability, PoC pass rate, and Functional pass rate.
    • Determination method: dynamic execution in a sandbox; unauthorized reads are matched using unique marker content, unauthorized writes are checked via database state plus application-side re-read; no LLM review participates in effectiveness determination.
    • Number of repetitions: each (model, vulnerability) pair is independently repeated 3 times under the same configuration, reporting each run and the mean; the average range R_m across the three runs for the 8 base LLMs is 8.69 percentage points (Equation 1).
    • Failure dimension annotation: four-dimensional labels are assigned by an LLM according to the rules in Table 3; 3 PhD students blindly labeled 108 patches (13.3% of the 810 dynamically failing patches) for reliability review.

    Main results

    According to Table 4 (mean of three runs, proportion of effective patches over 46 vulnerabilities):

    ModelConditionMean
    Claude Code (Opus 4.8)LLM Agent78.99%
    Codex (GPT-5.5)LLM Agent76.81%
    GPT-5.5Base LLM60.87%
    GLM-5.2Base LLM41.30%
    Qwen3.7-MaxBase LLM38.41%
    Kimi K2.7-CodeBase LLM37.68%
    DeepSeek-V4 ProBase LLM36.23%
    Claude Opus 4.8 / Gemini 3.5 FlashBase LLM30.43% / 30.43%
    MiMo-V2.5 ProBase LLM26.09%
    • The macro average of the two agents is 77.90%, and the macro average of the 8 base LLMs is 37.68%, a difference of 40.22 percentage points; for the same Opus 4.8 model, Claude Code is 78.99% versus 30.43% for the single-turn base condition, a difference of 48.56 percentage points.
    • Among the base LLMs, the average of the 4 closed-source models is 40.04%, and the average of the 4 open-weight models is 35.33%; the authors state that this indicates a moderate overall advantage for closed-source models but cannot establish their general superiority (GLM-5.2's 41.30% is higher than Claude Opus 4.8 and Gemini 3.5 Flash).

    RQ2: Failure stages and scaffold mitigation

    • Application failures are common: under the base condition, the macro-average Applicability is only 62.50% (Table 5), with Claude Opus 4.8 as low as 42.03%; the authors attribute this to hallucinated diff metadata (line count mismatches, malformed header syntax, path resolution failures, etc., with cases in Figures 2 and 3 and Appendix A).
    • Effect of Apply-Feedback: the macro-average Applicability rises from 62.50% to 96.11%, with GPT-5.5 reaching 100.00%; but the final effective rate only rises from 37.68% to 51.18% (+13.50 percentage points), and the authors state that this scaffold mainly mitigates application-stage failures and does not eliminate semantic failures (§5.2.1).
    • Combined Navigate-and-Locate (Table 6): the macro-average effective rate rises from 51.18% to 66.03% (+14.86 percentage points), a 28.35 percentage point improvement relative to the base condition; the PoC pass rate rises from 56.88% to 72.37%, the functional test pass rate only rises from 77.45% to 78.35%, and Applicability slightly decreases from 96.11% to 93.39%.
    • Exception: under the combined condition, Kimi K2.7-Code's effective rate decreases by 4.35 percentage points from the Apply-Feedback condition to 57.97%, the only one of the 8 models that did not improve (Table 6); the paper does not explain the reason.
    • Gap with agents: under the combined condition, Claude Opus 4.8 reaches 75.36%, 3.63 percentage points lower than Claude Code's 78.99% based on the same model; GPT-5.5 reaches 73.19%, 3.62 percentage points lower than Codex's 76.81%.

    RQ3: Four-dimensional failure analysis

    • Overall ranking (Table 7, 2735 patches that passed application and compilation): Content has the highest failure rate at 23.44%, followed by Mechanism 18.21%, Coverage 10.60%, and Position 6.00%; the authors therefore consider that the main difficulty lies in reconstructing the expected authorization policy and implementing it with a reliable mechanism, rather than locating the repair point.
    • Effect of scaffolds: the four-dimensional failure rates under the Apply-Feedback condition (9.27%/16.59%/27.16%/31.57%) are higher than under the base condition (4.98%/11.13%/19.93%/23.59%); the authors explain that this scaffold lets more semantically weak patches enter dynamic evaluation (samples increase from 602 to 928), rather than semantic repair getting worse; after adding Navigate-and-Locate, they drop to 4.36%/5.64%/11.49%/18.30%.
    • Dynamic failure modes (Table 8, 810 dynamically failing patches): among the 588 that fail the PoC but pass the functional test, Coverage failures account for 45.92%; among the 169 that pass the PoC but fail the functional test, Content failures account for 72.19%; among the 53 that fail both, Mechanism failures account for 84.91%.
    • Annotation reliability (Table 9): on 108 patches and 432 cells, the overall agreement between LLM labels and the three-person majority consensus is 96.3% (Cohen's κ = 0.926), with 16 disagreements; per-dimension κ ranges from 0.781 for Content to 1.000 for Coverage.

    RQ4: Comparison with official patches

    • Defects in official patches (Table 10): 6 official patches have defects—CVE-2022-4505 and CVE-2023-2946 pass the PoC but fail the functional test; CVE-2022-4684 and CVE-2022-4803 fail the PoC; CVE-2022-4802 fails both; for CVE-2023-31066, better-performing patches exist.
    • Cases: the official patch for CVE-2022-4505 treats the return value of array_search() as a boolean, so index 0 is misjudged (Figure 6); the official patch for CVE-2023-2946 uses the ACO name prescriptions instead of the configuration value rx (Figure 9); the authors state that the corresponding LLM patches avoided these mechanism-level errors.
    • Zero-day discovery: for CVE-2023-31066, multiple LLM patches incidentally protected the sibling path forceDelete, which the official patch did not cover; the authors confirmed that this path was still exploitable in the then-latest version 1.6.0, and after disclosure it was assigned CVE-2026-63040, with the maintainer releasing a fix on June 22, 2026.

    Other ablations and analyses

    • Staged macro averages under the base condition (Table 5): Applicability 62.50%, PoC 42.75%, Functional 49.46%, Effective 37.68%.
    • Under the combined condition, the average effective rate of the 4 closed-source base LLMs is 71.01%, and that of the 4 open-weight models is 61.05%, a difference of 9.96 percentage points (§5.2.2).
    • Model failure profiles under the base condition (Table 7): GPT-5.5 has the lowest Content failure rate (14.91%), Kimi K2.7-Code has the lowest Position and Coverage failure rates (both 1.45%), and MiMo-V2.5 Pro has the highest Coverage/Mechanism/Content failure rates (20.90%/32.84%/31.34%).
  5. What are some points that can be further explored?

    The authors noted limitations such as benchmark coverage and binary labeling, and plan to study policy inference and framework refinement; the experiments covered 10 systems and 46 vulnerabilities.

    Limitations and future directions noted by the authors

    • Generalizability: BAC-Bench covers 46 vulnerabilities from 6 applications and 4 languages, and the authors state that the conclusions may not generalize to Web applications in other languages or with other access control architectures (§7 External Threats).
    • Training data contamination: most vulnerabilities were disclosed around 2022 and may appear in model pretraining corpora; the authors state that sampled patches differ greatly from the official fixes and that one case fixed a zero-day that the model could not possibly have known in advance, and they consider that the results cannot be attributed to memorization (§7 Internal Threats).
    • Trade-off of binary annotation: the authors state that binary correctness annotation is only one practical way to enable a large-scale application framework and sacrifices analytical granularity, and they plan to further study and refine the framework (§6.3).
    • Future direction one: study techniques for inferring the expected access control policy of the target scenario from source code, using evidence such as sibling endpoints, data models, and project conventions (§6.3).
    • Future direction two: design a more effective and more efficient minimal BAC repair harness (§6.1).
    • Scope of Coverage scoring: vulnerability units are frozen only according to the attack paths explicitly recorded in the vulnerability description, and alternative attack paths are not separately enumerated or scored (§4.4.2).

    Scope of experimental coverage

    • The systems under test are 8 base LLMs plus 2 commercial LLM agents, 10 in total (Table 2).
    • The benchmark is 46 BAC vulnerabilities from 6 applications, covering PHP, Java, Go, and Python, with vulnerability types covering BFLA and BOLA, horizontal and vertical privilege escalation, and read and write operations (§7).
    • Each (model, vulnerability) pair is repeated 3 times; the Apply-Feedback self-healing budget is K=5, and the Navigate-and-Locate exploration budget is M=10 (§4.3).
    • The official patch comparison covers 6 defective patches among the 46 vulnerabilities, of which 3 received case analysis (§5.4).
    • The paper does not report the specific model of the LLM used for four-dimensional annotation, nor the generation parameters (such as temperature) of each model.
  6. Summarize the main content of the paper

    BAC-Bench benchmark plus a four-dimensional strategy framework: single-turn base LLMs repair 37.68%, and the two scaffolds raise this to 66.03%, approaching commercial agents.

    An empirical benchmark study on LLM repair of access control flaws in Web applications. BAC is a logic vulnerability with no fixed syntactic pattern, and the target policy is usually undocumented, making traditional template-based repair tools difficult to apply, and previously there was no standardized repair benchmark.

    • Benchmark: BAC-Bench contains 46 real BAC vulnerabilities (6 applications, 4 languages), each with a Docker sandbox, a PoC verification program, and a functional test program; effectiveness requires the patch to apply, compile, block the PoC, and preserve legitimate functionality.
    • Framework: proposes a Position/Coverage/Mechanism/Content four-dimensional repair strategy framework, uses an LLM to label patch failure dimensions, and manual blind-label review of 108 patches gives an agreement rate of 96.3% (κ = 0.926).
    • Main results: single-turn base LLMs repair 37.68% on average, and the two agents Claude Code and Codex average 77.90% (Table 4).
    • Scaffolds: Apply-Feedback raises the macro-average Applicability from 62.50% to 96.11%; after further combining Navigate-and-Locate, the average effective rate reaches 66.03%, with Claude Opus 4.8 reaching 75.36%, 3.63 percentage points lower than Claude Code's 78.99% based on the same model (Table 6).
    • Failure modes: the Content dimension has the highest failure rate (23.44%, Table 7), and the authors consider the difficulty to lie in reconstructing the expected authorization policy; in addition, 6 official patches have defects, and one LLM patch incidentally fixed a zero-day that had lain dormant for three years (CVE-2026-63040).
    • Authors' conclusion: LLMs can already take on part of the BAC repair work, and lightweight scaffolds can bring base LLMs close to agent level; the key next step is to infer accurate authorization policies for each application's specific business scenario.
Read originalarxiv.org