CVE-2024-34158 Stack exhaustion in Parse in go/build/constraint

High 7.5 Published Updated

Attackers can cause a panic and denial of service by providing deeply nested build tag expressions to the Go parser.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-34158?

CVE-2024-34158 is a high-severity denial of service vulnerability in go/build/constraint, published on 6 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Calling Parse on a "// +build" build tag line with deeply nested expressions can cause a panic due to stack exhaustion.

Weakness: CWE-674

Which versions are affected by CVE-2024-34158?

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

PackageAffectedFixed in
golang BitnamiAll versions1.22.7, 1.23.1
stdlib GoAll versions1.22.7, 1.23.1

How do I fix CVE-2024-34158?

Upgrade golang to a fixed version for your release line: 1.22.7 or 1.23.1.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-34158 being exploited?

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

Sources

Also known as AZL-48929, AZL-79078, AZL-98805, BELL-CVE-2024-34158, BIT-golang-2024-34158, DEBIAN-CVE-2024-34158 and 7 more.

Is CVE-2024-34158 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free