arXiv:2610.34290cs.CROct 2026

Manuscript Offprint

arXiv:2610.34290

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

Mingrui Liu, Liang He, Xinchu Wang, Yeting Li, Dongxu Han, Yunpeng Li, Yuling Liu

MINGRUI LIU, Institute of Information Engineering, Chinese Academy of Sciences, China

LIANG HE ✉^{✉}, Institute of Software, Chinese Academy of Sciences, China

XINCHU WANG, Institute of Information Engineering, Chinese Academy of Sciences, China

YETING LI, Institute of Information Engineering, Chinese Academy of Sciences, China

DONGXU HAN, Institute of Information Engineering, Chinese Academy of Sciences, China

YUNPENG LI ✉^{✉}, Institute of Information Engineering, Chinese Academy of Sciences, China

YULING LIU, Institute of Information Engineering, Chinese Academy of Sciences, China

Broken access control (BAC) ranks among the most severe web-application vulnerability classes, yet its automated repair remains largely unexplored. Unlike memory-safety vulnerabilities, BAC is a logic vulnerability whose repair demands a deep understanding of an application's access-control model and business semantics, which traditional automated vulnerability repair techniques handle poorly. Large language models (LLMs) open a promising avenue for this problem, but no standard benchmark exists for studying how well they repair BAC vulnerabilities. We construct BAC-BENCH, the first benchmark for BAC repair, consisting of 46 real-world BAC vulnerabilities drawn from six widely used web applications spanning four programming languages. Each vulnerability is equipped with a sandboxed runtime environment, a PoC validation program and a functional test program. We further propose a BAC repair-strategy framework that characterizes any BAC patch along four dimensions, Position, Coverage, Mechanism, and Content. Evaluating eight base LLMs and two commercial LLM agents on BAC-BENCH, we find that single-turn base LLMs repair 37.68% of the vulnerabilities on average, while two minimal scaffolds, Apply-Feedback and Navigate-and-Locate, raise this average to 66.03%, with the best base LLM reaching 75.36%, close to the 78.99% of the best agent. Notably, some LLM-generated patches surpass the official patches, and one incidentally closed a zero-day vulnerability that had lain dormant for three years. Our findings delineate the current capability boundary of LLM-based BAC repair and offer guidance toward its practical adoption.

CCS Concepts: • Software and its engineering → Software testing and debugging; • Security and privacy → Web application security.

Additional Key Words and Phrases: Broken Access Control, Vulnerability Repair, Large Language Model, Benchmark, Web Application

1 Introduction

Broken access control (BAC) has become one of the most damaging classes of software vulnerabilities. Reports from Mondoo and MITRE document the prevalence of BAC, with CWE-862 Missing Authorization increasing by 56% from 2024 to 2025 and rising from rank 9 to rank 4 in MITRE's 2025 CWE Top 25, while CWE-284 Improper Access Control increased by 73% [35, 36]. OWASP likewise ranks BAC the first web-application risk [49, 52] and the first API risk [50]. Its consequences are equally severe. In December 2024, the Irish Data Protection Commission fined Meta €251 million for an access-control design defect whose leaked access token exposed the profiles of 29 million users [10]. Meanwhile, the sheer scale of disclosure is overwhelming manual remediation, and AI is accelerating the trend. A record 48,185

Authors' Contact Information: Mingrui Liu, liumingrui2024@iie.an.cn, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China; Liang He, heliang@iscas.ac.cn, Institute of Software, Chinese Academy of Sciences, Beijing, China; Xinchu Wang, wangxinchu@iie.an.cn, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China; Yeting Li, liyeting@iie.an.cn, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China; Dongxu Han, handongxu@iie.an.cn, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China; Yunpeng Li, liyunpeng@iie.an.cn, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China; Yuling Liu, liuyuling@iie.an.cn, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China.

Liu et al.

CVEs were published in 2025 [18], and disclosures in the first four months of 2026 already ran 46% above projections, prompting FIRST to raise its full-year forecast to approximately 66,000 and putting annual disclosures on pace to approach 70,000 for the first time in history [15]. In May 2026, Anthropic reported that Project Glasswing had used a frontier model to uncover more than 10,000 high- or critical-severity vulnerabilities in widely deployed software within its first month, yet only 75 of the 530 such vulnerabilities disclosed to maintainers had been patched [2]. This combination of surging prevalence, severe impact, and lagging repair makes the automated repair of BAC vulnerabilities an urgent priority.

The detection of the BAC has been studied extensively [9, 33, 60, 65]. White-box approaches infer the intended access-control specification from the program itself and flag missing or inconsistent checks, with the detection granularity sharpened from the function level to the object level [23, 39, 65]. Black-box approaches drop the source-code requirement and instead decide violations from externally observable behavior [30, 85]. Work that directly targets BAC repair, by contrast, remains scarce. FixMeUp, one of the earliest such efforts, mines an access-control template from PHP applications and inserts it where a check is missing, but it relies on developers to hand-annotate sensitive operations and their checks [63]. LogicPatcher uses path profiling to place patches for already-detected vulnerabilities [38]. DRacv extends this paradigm to both PHP and Java, deriving patches from contrasts between vulnerable and protected pages and deploying each as a standalone guard file ahead of the vulnerable page [74]. Yet all of them handle only missing checks, rely on fixed templates or execution-flow patterns, and are designed for traditional architectures, limiting their applicability to the modern web applications in wide use today.

In summary, BAC repairing receive little attention from researchers because of three main reasons. (1) BAC is a logic vulnerability that lacks modelable syntactic and data-flow signatures. Unlike memory-safety vulnerabilities (e.g., buffer overflow, use-after-free) and injection vulnerabilities (e.g., SQL injection, XSS) that exhibit fixed syntactic patterns or explicit source-to-sink flows, BAC are deeply entangled with business logic and amount to the absence or malfunction of authorization logic, which has neither a fixed syntactic form nor a traceable flow, so pattern-based repair methods do not transfer. (2) Unlike detection, repairing task requires an explicit correctness specification to target. Detection need only judge whether an access violates the intended policy, which can be inferred from inconsistencies. Repairing task, by contrast, need to determine the intended access-control policy, which in practice is usually undocumented or scattered through the business logic, and then realize it faithfully within the concrete context of the application's source code. Any slight semantic ambiguity or implementation slip, can introduce new logic errors or over-restrict legitimate access. (3) Web access-control implementations are heterogeneous, lacking the standardized mechanisms of smart contracts. In smart contracts, access control centers on a few standardized mechanisms (e.g., msg.sender, the onlyOwner modifier), a regularity that recent smart-contract repair leverages by mining common RBAC practices to guide patch generation [80]. Web applications honor no such convention. Different applications adopt RBAC, ABAC, or DAC and realize their checks in disparate forms (session variables, database permission tables, or custom validators), with the logic often spread across many files and call layers, so a repair tool cannot rely on a uniform template or prior knowledge to patch accurately across applications.

The rapid progress of large language models (LLMs) opens a promising path to this problem and lends fresh hope to repairing complex BAC. Pre-trained on massive code corpora, LLMs command the syntax and semantics of mainstream programming languages and have internalized a wealth of framework idioms, API conventions, and secure-coding practices. Across downstream tasks ranging from resolving real-world repository issues [26] and detecting vulnerabilities [13] to localizing faults and repairing programs [21, 72, 81] and penetration testing [11], they already attain near-expert performance on a range of benchmarks, indicating that LLMs are now broadly capable of handling complex, context-coupled code and security tasks. More importantly, the distinctive strengths of LLMs directly address the core difficulties that have made BAC repair hard. Firstly, rather than matching a fixed syntactic pattern or template rule, an LLM identifies a missing or misconfigured authorization check through a holistic understanding of code semantics, reasoning from the surrounding business logic and thereby overcoming the absence of fixed syntactic or data-flow patterns. Secondly, an LLM can infer implicit access-control intent from code context, variable names, comments, and the implementation of sibling modules in the same project, reconstructing the intended access-control policy even without an explicit specification and thereby deciding what check to add and at what granularity to make the fix correct. Thirdly, having encountered RBAC, ABAC, and DAC models and their heterogeneous realizations, including session variables, permission-table lookups, and custom validation routines, throughout pre-training, an LLM generalizes across applications and languages, adapting to each project's checking logic without a uniform template or task-specific prior.

This raises the central empirical question: How effective are LLMs at repairing BAC vulnerabilities in web applications?

Despite a surge of LLM-based repair over the past two years [32, 41, 54, 77], research efforts on BAC in web applications have been lagged behind. Prior efforts either target memory-safety vulnerabilities, exploiting a crash or sanitizer signal to complete a locate-generate-and-validate loop, or, in the smart-contract setting, repair access control by mining standardized RBAC practices to guide the model [80], an approach that does not transfer to the diverse landscape of web applications. LLM-based repair of BAC in web applications thus remains largely unexplored, chiefly for want of a standardized repair benchmark. LLM-based repair research relies on standardized corpora that pair reproducible vulnerabilities with PoCs and ground-truth patches, yet no such BAC dataset exists in either industry or academia. The root difficulty is that BAC is a logic vulnerability whose triggering hinges on runtime context, including session state, role configuration, and initial database contents, and which therefore cannot be faithfully reproduced or tested in a standardized manner without a concrete execution environment. Absent such a benchmark, researchers can neither develop and study repair methods nor compare them fairly on equal footing.

To overcome these challenges, we construct BAC-BENCH, the first benchmark for BAC repair, consisting of 46 real-world BAC vulnerabilities drawn from six widely used web applications spanning four programming languages (Java, PHP, Go, and Python). Each vulnerability is equipped with a vulnerability description, a textual PoC description, the official patch, a sandboxed runtime environment, a PoC validation program, and a functional test program, enabling faithful reproduction of the vulnerability and dynamic validation of repairs. Building on this benchmark and an in-depth study of real-world BAC patches, we further propose a BAC repair-strategy framework that characterizes any BAC patch along four dimensions, Position, Coverage, Mechanism, and Content, and lays bare its internal construction and strategic choices. We then conduct an extensive evaluation on BAC-BENCH with eight base LLMs (DeepSeek-V4 Pro, Qwen3.7-Max, Claude Opus 4.8, GPT-5.5, GLM-5.2, MiMo-V2.5 Pro, Kimi K2.7-Code, and Gemini 3.5 Flash) and two commercial closed-source LLM agents (Claude Code and Codex). Our results show that single-turn base LLMs repair only 37.68% of the vulnerabilities on average, whereas two minimal scaffolds, Apply-Feedback and Navigate-and-Locate, raise this average to 66.03%, with Claude Opus 4.8 reaching 75.36%, only 3.63 percentage points below the 78.99% of Claude Code, the best-performing closed-source LLM agent built on the same model. We further find that some LLM-generated patches surpass the official fixes. On CVE-2023-31066, for example, an LLM-generated patch incidentally closed a latent access-control vulnerability that had gone undiscovered for over three years, which we responsibly disclosed to the Apache Software Foundation and the InLong maintainers and which was assigned CVE-2026-63040 [5]. These findings suggest that LLMs can already shoulder part of the BAC repair workload and point to a concrete path

Liu et al.

toward practical automated BAC repair. All datasets, scaffolds, LLM-generated patches, and experimental scripts are publicly available at https://github.com/TianMaXingK/BAC-BENCH [31].

In summary, this paper makes the following contributions:

(1) A real-world benchmark. We build BAC-BENCH, a benchmark of 46 real-world BAC vulnerabilities drawn from six widely used web applications spanning four programming languages (Java, PHP, Go, and Python). Each vulnerability is equipped with a vulnerability description, a textual PoC description, the official patch, a sandboxed runtime environment, a PoC validation program, and a functional test program. We open-source it to facilitate research on BAC repair in web applications.

(2) A repair-strategy framework. We propose a BAC repair-strategy framework that characterizes any BAC patch along four dimensions, Position, Coverage, Mechanism, and Content, enabling an in-depth analysis of how a BAC-patch is constructed and why it fails.

(3) A systematic evaluation. We systematically evaluate eight base LLMs and two commercial closed-source LLM agents on repairing BAC in web applications, and devise two minimal scaffolds that mitigate the limitations observed in base- LLM repair. Our findings offer guidance for project communities pursuing automated BAC repair.

References (12)