# CVE-2017-9798: Use after free in Apache HTTP Server

> Remote attackers can read secret data from process memory via unauthenticated OPTIONS requests due to a use-after-free flaw in Apache HTTP Server.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Sep 2017
- **Updated:** 4 Nov 2025
- **Also known as:** ALPINE-CVE-2017-9798, CLEANSTART-2026-BD59133, DEBIAN-CVE-2017-9798, DLA-1102-1, DSA-3980-1, GHSA-jxf6-fx3m-8x2r, MGASA-2018-0009, RHSA-2017:2882, RHSA-2017:3018, SUSE-SU-2017:2542-1, SUSE-SU-2017:2718-1, UBUNTU-CVE-2017-9798, USN-3425-1

## What is CVE-2017-9798?

CVE-2017-9798 is a high-severity use after free vulnerability in Apache Http Server, published on 18 Sep 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Apache httpd allows remote attackers to read secret data from process memory if the Limit directive can be set in a user's .htaccess file, or if httpd.conf has certain misconfigurations, aka Optionsbleed. This affects the Apache HTTP Server through 2.2.34 and 2.4.x through 2.4.27. The attacker sends an unauthenticated OPTIONS HTTP request when attempting to read secret data. This is a use-after-free issue and thus secret data is not always sent, and the specific data depends on many factors including configuration. Exploitation with .htaccess can be blocked with a patch to the ap_limit_section function in server/core.c.

Weakness: CWE-416 (Use After Free)

## Which versions are affected by CVE-2017-9798?

It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `httpd` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-manual` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-tools` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_ldap` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_proxy_html` | Red Hat:enterprise_linux:7::client | All versions | 1:2.4.6-67.el7_4.5 |
| `mod_session` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_ssl` | Red Hat:enterprise_linux:7::client | All versions | 1:2.4.6-67.el7_4.5 |
| `httpd` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-debuginfo` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-manual` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-tools` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_ldap` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_proxy_html` | Red Hat:enterprise_linux:7::computenode | All versions | 1:2.4.6-67.el7_4.5 |
| `mod_session` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_ssl` | Red Hat:enterprise_linux:7::computenode | All versions | 1:2.4.6-67.el7_4.5 |
| `httpd` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-debuginfo` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-devel` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-manual` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-tools` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_ldap` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_proxy_html` | Red Hat:enterprise_linux:7::server | All versions | 1:2.4.6-67.el7_4.5 |
| `mod_session` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_ssl` | Red Hat:enterprise_linux:7::server | All versions | 1:2.4.6-67.el7_4.5 |
| `httpd` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-debuginfo` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-devel` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-manual` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-67.el7_4.5 |
| `httpd-tools` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_ldap` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_proxy_html` | Red Hat:enterprise_linux:7::workstation | All versions | 1:2.4.6-67.el7_4.5 |
| `mod_session` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-67.el7_4.5 |
| `mod_ssl` | Red Hat:enterprise_linux:7::workstation | All versions | 1:2.4.6-67.el7_4.5 |
| `httpd24` | Red Hat:rhel_software_collections:3::el6 | All versions | 0:1.1-18.el6 |
| `httpd24-httpd` | Red Hat:rhel_software_collections:3::el6 | All versions | 0:2.4.27-8.el6 |
| `httpd24-httpd-debuginfo` | Red Hat:rhel_software_collections:3::el6 | All versions | 0:2.4.27-8.el6 |
| `httpd24-httpd-devel` | Red Hat:rhel_software_collections:3::el6 | All versions | 0:2.4.27-8.el6 |

Products: Apache Http Server, Debian Debian Linux.

## How do I fix CVE-2017-9798?

Apply the vendor's patch.

## Is CVE-2017-9798 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2017-9798 exists.

Public exploit code:

- OptionsBleed (CVE-2017-9798) PoC / Scanner (github_poc): https://github.com/brokensound77/OptionsBleed-POC-Scanner
- Checks a shared hosting environment for CVE-2017-9798 (github_poc): https://github.com/nitrado/CVE-2017-9798
- CVE-2017-9798 (github_poc): https://github.com/pabloec20/optionsbleed
- Apache < 2.2.34 / < 2.4.27 - OPTIONS Memory Leak (exploitdb)
- Apache Optionsbleed Scanner (metasploit)
- https://github.com/l0n3rs/CVE-2017-9798 (github_poc): https://github.com/l0n3rs/CVE-2017-9798

## Other vulnerabilities in Apache Http Server

- [CVE-2021-42013](https://insights.sbomify.com/CVE-2021-42013/): Apache HTTP Server Path Traversal (critical 9.8, exploited in the wild)
- [CVE-2024-38475](https://insights.sbomify.com/CVE-2024-38475/): Apache HTTP Server Improper Escaping of Output (critical 9.1, exploited in the wild)
- [CVE-2021-40438](https://insights.sbomify.com/CVE-2021-40438/): Apache HTTP Server-Side Request Forgery (SSRF) (critical 9.0, exploited in the wild)
- [CVE-2019-0211](https://insights.sbomify.com/CVE-2019-0211/): Apache HTTP Server Privilege Escalation (high 7.8, exploited in the wild)
- [CVE-2021-41773](https://insights.sbomify.com/CVE-2021-41773/): Apache HTTP Server Path Traversal (high 7.5, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2017-9798 and fix it if it is affected.

What it is: CVE-2017-9798 is a high-severity use after free vulnerability in Apache Http Server, published on 18 Sep 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2017-9798 exists.

Affected product: Apache Http Server. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2017-9798/ (Markdown: https://insights.sbomify.com/CVE-2017-9798/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2017-9798
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2017-9798
- OSV: https://osv.dev/vulnerability/CVE-2017-9798

---
From sbomify Insights: https://insights.sbomify.com/CVE-2017-9798/
Summaries are generated and may contain mistakes; the official description above is the record.
