Repairing Broken Access Control in Web Applications with LLMs: An Empirical Benchmark Study
Organizations: Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China · Institute of Software, Chinese Academy of Sciences, Beijing, China
Abstract
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.
Figures & tables
| Application | Language | Stars | Domain | Access-control model |
|---|---|---|---|---|
| OpenEMR | PHP | 5.2k | Healthcare Management | ACL + RBAC hybrid (phpGACL) |
| Usememos | Go | 52.8k | Note-taking Platform | RBAC |
| Apache InLong | Java | 1.5k | Data Integration Framework | RBAC + groups |
| BookWyrm | Python | 2.6k | Social Reading Platform | RBAC |
| XWiki | Java | 1.2k | Knowledge Management | ACL + groups |
| Nextcloud Server | PHP | 34k | Cloud Storage Platform | DAC + ACL + RBAC hybrid |
| Category | Model | Developer | Release | Access |
|---|---|---|---|---|
| LLM Agents | Claude Code (2.1.160) | Anthropic | 2026-06-02 | Closed |
| Codex (0.139.0) | OpenAI | 2026-06-09 | Closed | |
| Base LLMs | Claude Opus 4.8 | Anthropic | 2026-05-28 | Closed |
| GPT-5.5 | OpenAI | 2026-04-23 | Closed | |
| Qwen3.7-Max | Alibaba | 2026-05-20 | Closed | |
| Gemini 3.5 Flash | 2026-05-19 | Closed |
| Dimension | Fine-grained categories and criterion | Binary mapping |
|---|---|---|
| Position | Presentation, control, business, data, and cross-cutting authorization layers. A repair point is accurate only when it lies on the vulnerable execution path and is placed at a time that can constrain the sensitive operation. | Success: All required repair points are accurate. Failure: At least one repair point is inaccurate. |
| Coverage | The ratio , where is the number of vulnerability units frozen before inspecting candidate patches and is the number of units receiving a structural security intervention. | Success: , coverage complete. Failure: , coverage incomplete. |
| Mechanism | ①Standard mechanism reuse. ② Reliable project-native mechanism. ③ Fragile substitute mechanism. ④ Mechanism implementation failure. | Success: ① or ②. Failure: ③ or ④. |
| Content | Correct, partially correct, and incorrect. | Success: Correct only. Failure: Partially correct or incorrect . |
| Model | Condition | Run 1 | Run 2 | Run 3 | Mean |
|---|---|---|---|---|---|
| Claude Code(Opus 4.8) | LLM Agent | 84.78% | 71.74% | 80.43% | 78.99% |
| Codex(GPT-5.5) | LLM Agent | 78.26% | 76.09% | 76.09% | 76.81% |
| Macro-average | LLM Agent | 81.52% | 73.92% | 78.26% | 77.90% |
| DeepSeek-V4 Pro | Base LLM | 36.96% | 43.48% | 28.26% | 36.23% |
| Qwen3.7-Max | Base LLM | 36.96% | 41.30% | 36.96% | 38.41% |
| Claude Opus 4.8 | Base LLM | 30.43% | 34.78% | 26.09% | 30.43% |
| Model | Condition | Applicability | PoC | Functional | Effective |
|---|---|---|---|---|---|
| DeepSeek-V4 Pro | Base LLM | 60.14% | 39.86% | 49.28% | 36.23% |
| Qwen3.7-Max | Base LLM | 62.32% | 42.75% | 47.83% | 38.41% |
| Claude Opus 4.8 | Base LLM | 42.03% | 32.61% | 38.41% | 30.43% |
| GPT-5.5 | Base LLM | 86.96% | 68.12% | 73.19% | 60.87% |
| Gemini 3.5 Flash | Base LLM | 69.57% | 39.13% | 44.93% | 30.43% |
| GLM-5.2 | Base LLM | 64.49% | 43.48% | 55.07% | 41.30% |
| Model | Applicability | PoC | Functional | Effective |
|---|---|---|---|---|
| DeepSeek-V4 Pro | 91.30% ( -5.07 ) | 65.22% ( +3.62 ) | 79.71% (+0.00) | 62.32% ( +6.52 ) |
| Qwen3.7-Max | 100.00% ( +0.72 ) | 76.09% ( +17.39 ) | 78.26% ( -1.45 ) | 71.01% ( +15.94 ) |
| Claude Opus 4.8 | 100.00% ( +3.62 ) | 77.54% ( +19.57 ) | 91.30% ( +5.07 ) | 75.36% ( +18.84 ) |
| GPT-5.5 | 86.23% ( -13.77 ) | 81.16% ( +12.32 ) | 76.81% ( -6.52 ) | 73.19% ( +14.49 ) |
| Gemini 3.5 Flash | 87.68% ( -7.25 ) | 73.91% ( +26.09 ) | 73.19% ( +9.42 ) | 64.49% ( +23.91 ) |
| GLM-5.2 | 97.83% (+0.00) | 69.57% ( +26.09 ) | 81.88% ( -5.80 ) | 63.77% ( +23.19 ) |
| Model | Condition | Position | Coverage | Mechanism | Content | |
|---|---|---|---|---|---|---|
| Claude Code | LLM Agent | 133 | 3.01% | 9.02% | 8.27% | 14.29% |
| Codex | LLM Agent | 132 | 2.27% | 3.03% | 5.30% | 11.36% |
| DeepSeek-V4 Pro | Base LLM | 72 | 5.56% | 16.67% | 13.89% | 26.39% |
| Qwen3.7-Max | Base LLM | 73 | 5.48% | 10.96% | 20.55% | 24.66% |
| Claude Opus 4.8 | Base LLM | 55 | 1.82% | 14.55% | 9.09% | 21.82% |
| GPT-5.5 | Base LLM | 114 | 7.02% | 8.77% | 19.30% | 14.91% |
| Dynamic-failure type | Position | Coverage | Mechanism | Content | |
|---|---|---|---|---|---|
| PoC ✗, functional ✓ | 588 | 23.98% | 45.92% | 61.05% | 81.12% |
| PoC ✓, functional ✗ | 169 | 8.88% | 9.47% | 55.62% | 72.19% |
| PoC ✗, functional ✗ | 53 | 15.09% | 7.55% | 84.91% | 79.25% |
| Dimension | Agreement | Cohen’s | Corr. |
|---|---|---|---|
| Position | 98.1% | 0.955 | 2 |
| Coverage | 100.0% | 1.000 | 0 |
| Mechanism | 94.4% | 0.874 | 6 |
| Content | 92.6% | 0.781 | 8 |
| Overall | 96.3% | 0.926 | 16 |
| Vulnerability | Application | Official patch | |
|---|---|---|---|
| PoC test | Functional test | ||
| CVE-2022-4505 | OpenEMR | ✓ | ✗ |
| CVE-2023-2946 | OpenEMR | ✓ | ✗ |
| CVE-2022-4684 | Usememos | ✗ | ✓ |
| CVE-2022-4802 | Usememos | ✗ | ✗ |
| CVE-2022-4803 | Usememos | ✗ | ✓ |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Application | Vulnerability ( ) |
|---|---|
| OpenEMR (PHP) | CVE-2022-2730 ( ); CVE-2022-2824 ( ); CVE-2022-4505 ( ); CVE-2022-4567 ( ); CVE-2023-2942 ( ); CVE-2023-2944 ( ); CVE-2023-2945 ( ); CVE-2023-2946 ( ); (OE-1) ( ); CVE-2022-1177 ( ) |
| BookWyrm (Python) | BW-1 ( ); BW-2 ( ); BW-3 ( ); BW-4 ( ); BW-5 ( ) |
| Apache InLong (Java) | CVE-2023-31066 ( ); CVE-2023-31064 ( ); CVE-2023-31453 ( ); CVE-2023-31454 ( ) |
| XWiki (Java) | CVE-2022-23621 ( ); CVE-2022-23615 ( ); CVE-2021-32620 ( ); CVE-2022-41929 ( ); CVE-2021-32731 ( ) |
| Usememos (Go) | CVE-2022-4684 ( ); CVE-2022-4689 ( ); CVE-2022-4796 ( ); CVE-2022-4797 ( ); CVE-2022-4798 ( ); CVE-2022-4799 ( ); CVE-2022-4801 ( ); CVE-2022-4802 ( ); CVE-2022-4803 ( ); CVE-2022-4804 ( ); CVE-2022-4805 ( ); CVE-2022-4806 ( ); CVE-2022-4807 ( ); CVE-2022-4808 ( ); CVE-2022-4809 ( ); CVE-2022-4810 ( ); CVE-2022-4811 ( ); CVE-2022-4812 ( ); CVE-2022-4813 ( ); CVE-2022-4814 ( ) |
| Nextcloud (PHP) | CVE-2021-32688 ( ); CVE-2024-52514 ( ) |
Access Control
Access control specifies and enforces who or what may access data and perform actions, under which conditions.
See all 72 papers