CVE-2024-34156 Stack exhaustion in Decoder.Decode in encoding/gob

High 7.5 Published Updated

Attackers can cause a panic and denial of service by sending deeply nested structures to the Go encoding/gob decoder.

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-34156?

CVE-2024-34156 is a high-severity denial of service vulnerability in encoding/gob, 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 Decoder.Decode on a message which contains deeply nested structures can cause a panic due to stack exhaustion. This is a follow-up to CVE-2022-30635.

Which versions are affected by CVE-2024-34156?

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
Linux distribution packages (38)
git-lfs AlmaLinux:8All versions3.4.1-3.el8_10
containernetworking-plugins AlmaLinux:9All versions1:1.4.0-6.el9_4
containernetworking-plugins AlmaLinux:9All versions1:1.5.1-3.el9_5
delve AlmaLinux:9All versions1.24.1-2.el9_5
git-lfs AlmaLinux:9All versions3.4.1-4.el9_4
go-toolset AlmaLinux:9All versions1.23.6-2.el9_5
golang AlmaLinux:9All versions1.23.6-2.el9_5
golang-bin AlmaLinux:9All versions1.23.6-2.el9_5
golang-docs AlmaLinux:9All versions1.23.6-2.el9_5
golang-misc AlmaLinux:9All versions1.23.6-2.el9_5
golang-race AlmaLinux:9All versions1.23.6-2.el9_5
golang-src AlmaLinux:9All versions1.23.6-2.el9_5
golang-tests AlmaLinux:9All versions1.23.6-2.el9_5
grafana AlmaLinux:9All versions9.2.10-17.el9_4
grafana-pcp AlmaLinux:9All versions5.1.1-3.el9_4
grafana-pcp AlmaLinux:9All versions5.1.1-9.el9_5
grafana-selinux AlmaLinux:9All versions9.2.10-17.el9_4
osbuild-composer AlmaLinux:9All versions101-2.el9_4.alma.1
osbuild-composer AlmaLinux:9All versions118-2.el9_5.alma.1
osbuild-composer-core AlmaLinux:9All versions101-2.el9_4.alma.1
osbuild-composer-core AlmaLinux:9All versions118-2.el9_5.alma.1
osbuild-composer-worker AlmaLinux:9All versions101-2.el9_4.alma.1
osbuild-composer-worker AlmaLinux:9All versions118-2.el9_5.alma.1
skopeo AlmaLinux:9All versions2:1.14.5-2.el9_4
skopeo AlmaLinux:9All versions2:1.16.1-2.el9_5
skopeo-tests AlmaLinux:9All versions2:1.14.5-2.el9_4
skopeo-tests AlmaLinux:9All versions2:1.16.1-2.el9_5
git-lfs Red Hat:enterprise_linux:8::appstreamAll versions0:3.4.1-3.el8_10
git-lfs-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:3.4.1-3.el8_10
git-lfs-debugsource Red Hat:enterprise_linux:8::appstreamAll versions0:3.4.1-3.el8_10
containernetworking-plugins Red Hat:enterprise_linux:9::appstreamAll versions1:1.4.0-6.el9_4
containernetworking-plugins Red Hat:enterprise_linux:9::appstreamAll versions1:1.5.1-3.el9_5
containernetworking-plugins-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions1:1.4.0-6.el9_4
containernetworking-plugins-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions1:1.5.1-3.el9_5
containernetworking-plugins-debugsource Red Hat:enterprise_linux:9::appstreamAll versions1:1.4.0-6.el9_4
containernetworking-plugins-debugsource Red Hat:enterprise_linux:9::appstreamAll versions1:1.5.1-3.el9_5
git-lfs Red Hat:enterprise_linux:9::appstreamAll versions0:3.4.1-4.el9_4
git-lfs-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions0:3.4.1-4.el9_4

How do I fix CVE-2024-34156?

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-34156 being exploited?

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

Sources

Also known as ALSA-2024:11216, ALSA-2024:11217, ALSA-2024:6946, ALSA-2024:6947, ALSA-2024:7135, ALSA-2024:7136 and 80 more.

Is CVE-2024-34156 in your software?

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

Check your SBOMs for free