cve.bz

CVE-2021-40346 Year 2038 problem, Y2K38, Y2038, Epochalypse

7.5 highExploit referenceEPSS 59%Fix available

High (7.5). EPSS 59% estimated probability of exploitation activity in the next 30 days.

On this page
An integer overflow exists in HAProxy 2.0 through 2.5 in htx_add_header that can be exploited to perform an HTTP request smuggling attack, allowing an attacker to bypass all configured http-request HAProxy ACLs and possibly other ACLs.

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
EPSS
59% (unchanged from 59% a week ago; 59% 30 days ago) estimated probability of exploitation activity in the next 30 days; 99th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-190 Integer Overflow or Wraparound (Year 2038 problem, Y2K38, Y2038, Epochalypse)
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-40346 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-40346?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-40346?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-40346 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
haproxy:haproxyfrom 2.0.0 before 2.0.25
haproxy:haproxyfrom 2.2.0 before 2.2.17
haproxy:haproxyfrom 2.3.0 before 2.3.14
haproxy:haproxyfrom 2.4.0 before 2.4.4
haproxy:haproxy2.5:dev0
haproxy:haproxy2.5:dev1
haproxy:haproxy2.5:dev2
haproxy:haproxy2.5:dev3
haproxy:haproxy2.5:dev4
haproxy:haproxy2.5:dev5
haproxy:haproxy2.5:dev6
debian:debian_linux11.0
fedoraproject:fedora33
fedoraproject:fedora34

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11haproxy2.2.9-2+deb11u2DSA-4968-1
Debian12, 13, 14haproxy2.2.16-3DEBIAN-CVE-2021-40346
Ubuntu20.04:LTShaproxy2.0.13-2ubuntu0.3UBUNTU-CVE-2021-40346 USN-5063-1
Ubuntu22.04:LTShaproxy2.2.9-2ubuntu2UBUNTU-CVE-2021-40346
Red Hatopenshift:4.6::el7haproxy, haproxy20, haproxy-debuginfo0:2.0.16-2.el7RHSA-2022:0024
Red Hatopenshift:4.6::el8haproxy, haproxy20, haproxy-debugsource and 1 more0:2.0.16-4.el8RHSA-2022:0024
Red Hatopenshift:4.7::el7haproxy, haproxy20, haproxy-debuginfo0:2.0.19-2.el7RHSA-2022:0114
Red Hatopenshift:4.7::el8haproxy, haproxy20, haproxy-debugsource and 1 more0:2.0.19-2.el8RHSA-2022:0114
Red Hatopenshift:4.8::el7haproxy, haproxy-debuginfo0:2.2.13-2.el7RHSA-2021:5208
Red Hatopenshift:4.8::el8haproxy, haproxy-debugsource0:2.2.13-2.el8RHSA-2021:5208
Red Hatopenshift:4.9::el8haproxy, haproxy-debugsource0:2.2.15-2.el8RHSA-2021:4118
SUSELinux Enterprise High Availability Extension 15haproxy2.0.14-3.31.1SUSE-SU-2021:3258-1
SUSELinux Enterprise High Availability Extension 15 SP1haproxy2.0.14-8.23.1SUSE-SU-2021:3257-1
SUSELinux Enterprise High Availability Extension 15 SP2, Linux Enterprise High Availability Extension 15 SP3haproxy2.0.14-11.11.1SUSE-SU-2021:2975-1
openSUSELeap 15.2haproxy2.0.14-lp152.2.6.1openSUSE-SU-2021:1329-1
openSUSELeap 15.3haproxy2.0.14-11.11.1openSUSE-SU-2021:2975-1
openSUSETumbleweedhaproxy2.4.4+git0.acb1d0bea-1.2openSUSE-SU-2024:10839-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's mitigation

To mitigate this problem the following can be added to proxy config:

http-request deny if { req.hdr_cnt(content-length) gt 1 }

http-response deny if { res.hdr_cnt(content-length) gt 1 }

ProductPackageStateAdvisory
Red Hat OpenShift Container Platform 4.6haproxy-0:2.0.16-2.el7Fixed 2022-01-12RHSA-2022:0024
Red Hat OpenShift Container Platform 4.7haproxy-0:2.0.19-2.el7Fixed 2022-01-19RHSA-2022:0114
Red Hat OpenShift Container Platform 4.8haproxy-0:2.2.13-2.el7Fixed 2022-01-05RHSA-2021:5208
Red Hat OpenShift Container Platform 4.9haproxy-0:2.2.15-2.el8Fixed 2021-11-10RHSA-2021:4118
Red Hat Enterprise Linux 6haproxyNot affected
Red Hat Enterprise Linux 7haproxyNot affected
Red Hat Enterprise Linux 8haproxyNot affected
Red Hat Enterprise Linux 9haproxyNot affected
Red Hat OpenShift Container Platform 3.11haproxyOut of support scope
Red Hat Software Collectionsrh-haproxy18-haproxyNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-40346.

GitHub PoC

Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.

Attack patterns (CAPEC)

  • CAPEC-92 Forced Integer Overflow Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON