# CVE-2024-24791: Denial of service due to improper 100-continue handling in net/http

> An attacker can cause denial of service in Go HTTP reverse proxies by exploiting improper handling of 100-continue responses.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 Jul 2024
- **Updated:** 4 Oct 2024
- **Also known as:** ALSA-2024:7349, AZL-43068, AZL-78960, AZL-98754, BELL-CVE-2024-24791, BIT-golang-2024-24791, DEBIAN-CVE-2024-24791, GHSA-hw49-2p59-3mhj, GO-2024-2963, MGASA-2024-0261, MINI-3c73-xq4q-9g4p, MINI-3j55-4wvx-94xr, MINI-rcqf-6f74-r4hx, OESA-2024-1952, OESA-2024-1978, OESA-2024-1979, OESA-2024-1980, OESA-2024-2059, OESA-2025-1057, OESA-2025-1058, RHSA-2024:7349, RLSA-2024:7349, SUSE-SU-2024:2294-1, SUSE-SU-2024:2295-1, SUSE-SU-2024:2308-1, SUSE-SU-2024:2309-1, UBUNTU-CVE-2024-24791, openSUSE-SU-2024:14091-1, openSUSE-SU-2024:14098-1, openSUSE-SU-2024:14107-1

## What is CVE-2024-24791?

CVE-2024-24791 is a high-severity denial of service vulnerability in Go standard library net/http, published on 2 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The net/http HTTP/1.1 client mishandled the case where a server responds to a request with an "Expect: 100-continue" header with a non-informational (200 or higher) status. This mishandling could leave a client connection in an invalid state, where the next request sent on the connection will fail. An attacker sending a request to a net/http/httputil.ReverseProxy proxy can exploit this mishandling to cause a denial of service by sending "Expect: 100-continue" requests which elicit a non-informational response from the backend. Each such request leaves the proxy with an invalid connection, and causes one subsequent request using that connection to fail.

## Which versions are affected by CVE-2024-24791?

2 open source packages ship an affected version, including golang and stdlib.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `golang` | Bitnami | All versions | 1.21.12, 1.22.5 |
| `stdlib` | Go | All versions | 1.21.12, 1.22.5 |
| `grafana` | AlmaLinux:8 | All versions | 9.2.10-18.el8_10 |
| `grafana-selinux` | AlmaLinux:8 | All versions | 9.2.10-18.el8_10 |
| `grafana` | Red Hat:enterprise_linux:8::appstream | All versions | 0:9.2.10-18.el8_10 |
| `grafana-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:9.2.10-18.el8_10 |
| `grafana-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:9.2.10-18.el8_10 |
| `grafana-selinux` | Red Hat:enterprise_linux:8::appstream | All versions | 0:9.2.10-18.el8_10 |
| `grafana` | Rocky Linux:8 | All versions | 0:9.2.10-18.el8_10 |
| `go1.21` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 1.21.12-150000.1.39.1 |
| `go1.21` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 1.21.12-150000.1.39.1 |
| `go1.21` | SUSE:Linux Enterprise Module for Development Tools 15 SP5 | All versions | 1.21.12-150000.1.39.1 |
| `go1.22` | SUSE:Linux Enterprise Module for Development Tools 15 SP5 | All versions | 1.22.5-150000.1.21.1 |
| `go1.21` | SUSE:Linux Enterprise Module for Development Tools 15 SP6 | All versions | 1.21.12-150000.1.39.1 |
| `go1.22` | SUSE:Linux Enterprise Module for Development Tools 15 SP6 | All versions | 1.22.5-150000.1.21.1 |
| `go1.21` | SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 1.21.12-150000.1.39.1 |
| `go1.21` | SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | All versions | 1.21.12-150000.1.39.1 |
| `go1.21` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 1.21.12-1.39.1 |
| `go1.22` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 1.22.5-1.15.1 |
| `go1.21` | openSUSE:Leap 15.5 | All versions | 1.21.12-150000.1.39.1 |
| `go1.22` | openSUSE:Leap 15.5 | All versions | 1.22.5-150000.1.21.1 |
| `go1.21` | openSUSE:Leap 15.6 | All versions | 1.21.12-150000.1.39.1 |
| `go1.22` | openSUSE:Leap 15.6 | All versions | 1.22.5-150000.1.21.1 |
| `forgejo` | openSUSE:Tumbleweed | All versions | 7.0.5-1.1 |
| `go1.21` | openSUSE:Tumbleweed | All versions | 1.21.12-1.1 |
| `go1.22` | openSUSE:Tumbleweed | All versions | 1.22.5-1.1 |

## How do I fix CVE-2024-24791?

Upgrade golang to a fixed version for your release line: 1.21.12 or 1.22.5.

## Is CVE-2024-24791 being exploited?

There is no known exploitation of CVE-2024-24791 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-24791 and fix it if it is affected.

What it is: CVE-2024-24791 is a high-severity denial of service vulnerability in Go standard library net/http, published on 2 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-24791 in the wild and no public exploit code.

Affected packages and fixed versions:
- golang (Bitnami): affected all versions; fixed in 1.21.12, 1.22.5
- stdlib (Go): affected all versions; fixed in 1.21.12, 1.22.5

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-2024-24791/ (Markdown: https://insights.sbomify.com/CVE-2024-24791/index.md)
```

## Sources

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

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