# CVE-2024-24788: Malformed DNS message can cause infinite loop in net

> A malformed DNS response causes an infinite loop in Go's net package, leading to denial of service for applications using DNS lookups.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/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:** 8 May 2024
- **Updated:** 13 Feb 2025
- **Also known as:** ALSA-2024:9200, ALSA-2024:9277, AZL-40375, AZL-40436, AZL-40471, AZL-40480, AZL-40517, AZL-79020, AZL-98589, BELL-CVE-2024-24788, BIT-golang-2024-24788, GHSA-2jwv-jmq4-4j3r, GO-2024-2824, MGASA-2024-0181, RHBA-2024:3840, RHSA-2024:9200, RHSA-2024:9277, RLSA-2024:9200, RLSA-2024:9277, UBUNTU-CVE-2024-24788, openSUSE-SU-2024:13990-1, openSUSE-SU-2024:14000-1

## What is CVE-2024-24788?

CVE-2024-24788 is a medium-severity denial of service vulnerability in Go standard library net, published on 8 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A malformed DNS message in response to a query can cause the Lookup functions to get stuck in an infinite loop.

Weakness: CWE-835 (Loop with Unreachable Exit Condition)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `golang` | Bitnami | From 1.22.0-0 | 1.22.3 |
| `stdlib` | Go | From 1.22.0-0 | 1.22.3 |
| `oci-seccomp-bpf-hook` | AlmaLinux:9 | All versions | 1.2.10-2.el9 |
| `runc` | AlmaLinux:9 | All versions | 4:1.1.13-4.el9 |
| `go-toolset` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.21.10-1.el9_4 |
| `golang` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.21.10-1.el9_4 |
| `golang-bin` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.21.10-1.el9_4 |
| `golang-docs` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.21.10-1.el9_4 |
| `golang-misc` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.21.10-1.el9_4 |
| `golang-src` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.21.10-1.el9_4 |
| `golang-tests` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.21.10-1.el9_4 |
| `oci-seccomp-bpf-hook` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.2.10-2.el9 |
| `oci-seccomp-bpf-hook-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.2.10-2.el9 |
| `oci-seccomp-bpf-hook-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.2.10-2.el9 |
| `runc` | Red Hat:enterprise_linux:9::appstream | All versions | 4:1.1.13-4.el9 |
| `runc-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 4:1.1.13-4.el9 |
| `runc-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 4:1.1.13-4.el9 |
| `oci-seccomp-bpf-hook` | Rocky Linux:9 | All versions | 0:1.2.10-2.el9 |
| `runc` | Rocky Linux:9 | All versions | 4:1.1.13-4.el9 |
| `forgejo` | openSUSE:Tumbleweed | All versions | 7.0.3-1.1 |
| `traefik` | openSUSE:Tumbleweed | All versions | 3.0.1-1.1 |

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

Upgrade golang to 1.22.3 or later.

## Is CVE-2024-24788 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-24788 is a medium-severity denial of service vulnerability in Go standard library net, published on 8 May 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-24788 in the wild and no public exploit code.

Affected packages and fixed versions:
- golang (Bitnami): affected from 1.22.0-0; fixed in 1.22.3
- stdlib (Go): affected from 1.22.0-0; fixed in 1.22.3

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

## Sources

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

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