# CVE-2025-40907: FCGI versions 0.44 through 0.82, for Perl, include a vulnerable version of the FastCGI fcgi2 (aka fcgi) library

> An integer overflow in the Perl FCGI library allows attackers to trigger a heap-based buffer overflow via crafted IPC socket data, potentially leading to code execution or denial of service.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 16 May 2025
- **Updated:** 5 Sep 2025
- **Also known as:** ALSA-2025:8635, ALSA-2025:8636, ALSA-2025:8696, AZL-61899, AZL-61905, CLSA-2025-1762958433, CLSA-2025-1764321881, DEBIAN-CVE-2025-40907, GHSA-488m-4fx8-f36v, MGASA-2025-0277, OESA-2025-1544, RHSA-2025:8625, RHSA-2025:8635, RHSA-2025:8636, RHSA-2025:8677, RHSA-2025:8678, RHSA-2025:8696, RHSA-2025:8697, RHSA-2025:8698, RHSA-2025:8703, RHSA-2025:8829, RHSA-2025:8890, RLSA-2025:8635, RLSA-2025:8636, RLSA-2025:8696, UBUNTU-CVE-2025-40907, USN-7527-1

## What is CVE-2025-40907?

CVE-2025-40907 is a medium-severity vulnerability in ETHER FCGI, published on 16 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-190 (Integer Overflow or Wraparound), CWE-1395 (Dependency on Vulnerable Third-Party Component), CWE-122 (Heap-based Buffer Overflow)

## Which versions are affected by CVE-2025-40907?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `perl-FCGI` | AlmaLinux:10 | All versions | 1:0.82-13.1.el10_0 |
| `perl-FCGI` | AlmaLinux:8 | All versions | 1:0.78-12.module_el8.10.0+4011+62915be2 |
| `perl-FCGI` | AlmaLinux:8 | All versions | 1:0.78-12.module_el8.10.0+4012+cd64a238 |
| `perl-FCGI` | AlmaLinux:8 | All versions | 1:0.78-12.module_el8.10.0+4013+e6a7e623 |
| `perl-FCGI` | AlmaLinux:9 | All versions | 1:0.79-8.1.el9_6 |
| `perl-FCGI` | Red Hat:enterprise_linux:10.0 | All versions | 1:0.82-13.1.el10_0 |
| `perl-FCGI-debuginfo` | Red Hat:enterprise_linux:10.0 | All versions | 1:0.82-13.1.el10_0 |
| `perl-FCGI-debugsource` | Red Hat:enterprise_linux:10.0 | All versions | 1:0.82-13.1.el10_0 |
| `perl-FCGI` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.78-12.module+el8.10.0+23147+df114ff4 |
| `perl-FCGI-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.78-12.module+el8.10.0+23147+df114ff4 |
| `perl-FCGI-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.78-12.module+el8.10.0+23147+df114ff4 |
| `perl-FCGI` | Red Hat:enterprise_linux:9::appstream | All versions | 1:0.79-8.1.el9_6 |
| `perl-FCGI-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 1:0.79-8.1.el9_6 |
| `perl-FCGI-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 1:0.79-8.1.el9_6 |
| `perl-FCGI` | Red Hat:rhel_aus:8.2::appstream | All versions | 1:0.78-11.module+el8.2.0+23234+edafdda3.1 |
| `perl-FCGI-debuginfo` | Red Hat:rhel_aus:8.2::appstream | All versions | 1:0.78-11.module+el8.2.0+23234+edafdda3.1 |
| `perl-FCGI-debugsource` | Red Hat:rhel_aus:8.2::appstream | All versions | 1:0.78-11.module+el8.2.0+23234+edafdda3.1 |
| `perl-FCGI` | Red Hat:rhel_aus:8.4::appstream | All versions | 1:0.78-11.module+el8.4.0+23229+35c4aba7.1 |
| `perl-FCGI-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 1:0.78-11.module+el8.4.0+23229+35c4aba7.1 |
| `perl-FCGI-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 1:0.78-11.module+el8.4.0+23229+35c4aba7.1 |
| `perl-FCGI` | Red Hat:rhel_aus:8.6::appstream | All versions | 1:0.78-11.module+el8.6.0+23193+c3786137.1 |
| `perl-FCGI-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 1:0.78-11.module+el8.6.0+23193+c3786137.1 |
| `perl-FCGI-debugsource` | Red Hat:rhel_aus:8.6::appstream | All versions | 1:0.78-11.module+el8.6.0+23193+c3786137.1 |
| `perl-FCGI` | Red Hat:rhel_e4s:8.6::appstream | All versions | 1:0.78-11.module+el8.6.0+23193+c3786137.1 |
| `perl-FCGI-debuginfo` | Red Hat:rhel_e4s:8.6::appstream | All versions | 1:0.78-11.module+el8.6.0+23193+c3786137.1 |
| `perl-FCGI-debugsource` | Red Hat:rhel_e4s:8.6::appstream | All versions | 1:0.78-11.module+el8.6.0+23193+c3786137.1 |
| `perl-FCGI` | Red Hat:rhel_e4s:8.8::appstream | All versions | 1:0.78-11.module+el8.8.0+23188+f6366248.1 |
| `perl-FCGI-debuginfo` | Red Hat:rhel_e4s:8.8::appstream | All versions | 1:0.78-11.module+el8.8.0+23188+f6366248.1 |
| `perl-FCGI-debugsource` | Red Hat:rhel_e4s:8.8::appstream | All versions | 1:0.78-11.module+el8.8.0+23188+f6366248.1 |
| `perl-FCGI` | Red Hat:rhel_e4s:9.0::appstream | All versions | 1:0.79-8.el9_0.1 |
| `perl-FCGI-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 1:0.79-8.el9_0.1 |
| `perl-FCGI-debugsource` | Red Hat:rhel_e4s:9.0::appstream | All versions | 1:0.79-8.el9_0.1 |
| `perl-FCGI` | Red Hat:rhel_e4s:9.2::appstream | All versions | 1:0.79-8.el9_2.1 |
| `perl-FCGI-debuginfo` | Red Hat:rhel_e4s:9.2::appstream | All versions | 1:0.79-8.el9_2.1 |
| `perl-FCGI-debugsource` | Red Hat:rhel_e4s:9.2::appstream | All versions | 1:0.79-8.el9_2.1 |
| `perl-FCGI` | Red Hat:rhel_els:7 | All versions | 1:0.74-8.el7_9.1 |
| `perl-FCGI-debuginfo` | Red Hat:rhel_els:7 | All versions | 1:0.74-8.el7_9.1 |
| `perl-FCGI` | Red Hat:rhel_eus:9.4::appstream | All versions | 1:0.79-8.el9_4.1 |
| `perl-FCGI-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 1:0.79-8.el9_4.1 |
| `perl-FCGI-debugsource` | Red Hat:rhel_eus:9.4::appstream | All versions | 1:0.79-8.el9_4.1 |

Products: Fastcgi Fcgi.

## How do I fix CVE-2025-40907?

Upgrade to a fixed version.

## Is CVE-2025-40907 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-40907 exists.

## Other vulnerabilities in ETHER FCGI

- [CVE-2012-6687](https://insights.sbomify.com/CVE-2012-6687/): Denial of service in n/a (medium 5.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-40907 and fix it if it is affected.

What it is: CVE-2025-40907 is a medium-severity vulnerability in ETHER FCGI, published on 16 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-40907 exists.

Affected product: ETHER FCGI. No package-level version data is available, so check the vendor advisory linked from the reference page.

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

## Sources

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

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