cve.bz

CVE-2025-40907 fastcgi fcgi: Year 2038 problem, Y2K38, Y2038, Epochalypse

5.3 mediumExploit referenceEPSS 0.7%Fix available

Medium (5.3) in fastcgi fcgi. EPSS 0.7% estimated probability of exploitation activity in the next 30 days.

On this page
FCGI versions 0.44 through 0.82, for Perl, include a vulnerable version of the FastCGI fcgi2 (aka fcgi) library. The included FastCGI library is affected by CVE-2025-23016, causing an integer overflow (and resultant heap-based buffer overflow) via crafted nameLen or valueLen values in data to the IPC socket. This occurs in ReadParams in fcgiapp.c.

Severity

CVSS 3.1

5.3 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS
0.7% (unchanged from 0.7% a week ago; 0.7% 30 days ago) estimated probability of exploitation activity in the next 30 days; 54th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: partial, assessed 2025-05-16. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-190 Integer Overflow or Wraparound (Year 2038 problem, Y2K38, Y2038, Epochalypse)
CWE-122 Heap-based Buffer Overflow
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-40907 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-40907?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-40907?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-2025-40907 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 CNA's record in the CVE List.

ProductAffected
ETHER FCGIfrom 0.44 through 0.82

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14libfcgi-perl0.79+ds-2DEBIAN-CVE-2025-40907
Ubuntu20.04:LTSlibfcgi-perl0.79-1ubuntu0.1UBUNTU-CVE-2025-40907 USN-7527-1
UbuntuPro:16.04:LTSlibfcgi-perl0.77-1ubuntu0.1~esm1UBUNTU-CVE-2025-40907 USN-7527-1
UbuntuPro:18.04:LTSlibfcgi-perl0.78-2ubuntu0.1~esm1UBUNTU-CVE-2025-40907 USN-7527-1
Red Hatenterprise_linux:8::appstreamperl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.78-12.module+el8.10.0+23147+df114ff4RHSA-2025:8696
Red Hatenterprise_linux:9::appstreamperl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.79-8.1.el9_6RHSA-2025:8635
Red Hatenterprise_linux:10.0perl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.82-13.1.el10_0RHSA-2025:8636
Red Hatrhel_aus:8.2::appstreamperl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.78-11.module+el8.2.0+23234+edafdda3.1RHSA-2025:8829
Red Hatrhel_aus:8.4::appstreamperl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.78-11.module+el8.4.0+23229+35c4aba7.1RHSA-2025:8703
Red Hatrhel_aus:8.6::appstream, rhel_e4s:8.6::appstream, rhel_tus:8.6::appstreamperl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.78-11.module+el8.6.0+23193+c3786137.1RHSA-2025:8890
Red Hatrhel_e4s:8.8::appstream, rhel_tus:8.8::appstreamperl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.78-11.module+el8.8.0+23188+f6366248.1RHSA-2025:8698
Red Hatrhel_e4s:9.0::appstreamperl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.79-8.el9_0.1RHSA-2025:8678
Red Hatrhel_e4s:9.2::appstreamperl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.79-8.el9_2.1RHSA-2025:8697
Red Hatrhel_els:7perl-FCGI, perl-FCGI-debuginfo1:0.74-8.el7_9.1RHSA-2025:8625
Red Hatrhel_eus:9.4::appstreamperl-FCGI, perl-FCGI-debuginfo, perl-FCGI-debugsource1:0.79-8.el9_4.1RHSA-2025:8677
AlmaLinux8perl-FCGI1:0.78-12.module_el8.10.0+4011+62915be2ALSA-2025:8696
AlmaLinux8perl-FCGI1:0.78-12.module_el8.10.0+4012+cd64a238ALSA-2025:8696
AlmaLinux8perl-FCGI1:0.78-12.module_el8.10.0+4013+e6a7e623ALSA-2025:8696
AlmaLinux9perl-FCGI1:0.79-8.1.el9_6ALSA-2025:8635
AlmaLinux10perl-FCGI1:0.82-13.1.el10_0ALSA-2025:8636
Rocky Linux8perl-FCGI1:0.78-12.module+el8.10.0+1990+6591fbc7RLSA-2025:8696
Rocky Linux8perl-FCGI1:0.78-12.module+el8.10.0+1990+7f517b07RLSA-2025:8696
Rocky Linux8perl-FCGI1:0.78-12.module+el8.10.0+1990+99c43398RLSA-2025:8696
Rocky Linux8perl-FCGI1:0.78-12.module+el8.10.0+1990+d30a9ea8RLSA-2025:8696
Rocky Linux9perl-FCGI1:0.79-8.1.el9_6RLSA-2025:8635
Rocky Linux10perl-FCGI1:0.82-13.1.el10_0RLSA-2025:8636
Azure Linux2perl-FCGIno fix listedAZL-61905
Azure Linux3perl-FCGIno fix listedAZL-61899

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; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability is Important rather than just a Moderate flaw because it stems from an integer overflow in the allocation size calculation during parameter parsing in the FastCGI implementation. When the application processes incoming FastCGI parameters, it calculates the total size of memory to allocate by adding the name and value lengths along with two additional bytes. On 32-bit systems, this arithmetic operation can wrap around (due to the limited 32-bit size of size_t), leading to a significantly smaller allocation than intended. However, subsequent calls to FCGX_GetStr use the original (large) lengths provided by the attacker and write far beyond the allocated memory region (heap overflow). Unlike a moderate vulnerability (e.g., memory leak or a simple read out-of-bounds), this heap overflow directly allows an attacker to overwrite adjacent memory in the heap in a controlled way, potentially leading to arbitrary code execution, data corruption, or privilege escalation.

Red Hat's mitigation

No mitigation is currently available that meets Red Hat Product Security’s standards for usability, deployment, applicability, or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10perl-FCGI-1:0.82-13.1.el10_0Fixed 2025-06-09RHSA-2025:8636
Red Hat Enterprise Linux 7 Extended Lifecycle Supportperl-FCGI-1:0.74-8.el7_9.1Fixed 2025-06-09RHSA-2025:8625
Red Hat Enterprise Linux 8perl-FCGI:0.78-8100020250529111022.491cfe3dFixed 2025-06-09RHSA-2025:8696
Red Hat Enterprise Linux 8.2 Advanced Update Supportperl-FCGI:0.78-8020020250607180124.89a48cc6Fixed 2025-06-11RHSA-2025:8829
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportperl-FCGI:0.78-8040020250606192145.18ae627eFixed 2025-06-09RHSA-2025:8703
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Supportperl-FCGI:0.78-8060020250604201935.513b2a65Fixed 2025-06-11RHSA-2025:8890
Red Hat Enterprise Linux 8.6 Telecommunications Update Serviceperl-FCGI:0.78-8060020250604201935.513b2a65Fixed 2025-06-11RHSA-2025:8890
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutionsperl-FCGI:0.78-8060020250604201935.513b2a65Fixed 2025-06-11RHSA-2025:8890
Red Hat Enterprise Linux 8.8 Telecommunications Update Serviceperl-FCGI:0.78-8080020250603232512.6ceb32a8Fixed 2025-06-09RHSA-2025:8698
Red Hat Enterprise Linux 8.8 Update Services for SAP Solutionsperl-FCGI:0.78-8080020250603232512.6ceb32a8Fixed 2025-06-09RHSA-2025:8698
Red Hat Enterprise Linux 9perl-FCGI-1:0.79-8.1.el9_6Fixed 2025-06-09RHSA-2025:8635
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutionsperl-FCGI-1:0.79-8.el9_0.1Fixed 2025-06-09RHSA-2025:8678
Red Hat Enterprise Linux 9.2 Update Services for SAP Solutionsperl-FCGI-1:0.79-8.el9_2.1Fixed 2025-06-09RHSA-2025:8697
Red Hat Enterprise Linux 9.4 Extended Update Supportperl-FCGI-1:0.79-8.el9_4.1Fixed 2025-06-09RHSA-2025:8677

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-2025-40907.

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