CVE-2004-0940: Apache HTTP Server mod_include SSI Buffer Overflow
- Vendors
- Apache Software FoundationHewlett Packard EnterpriseOpenpkgTrustixSlackwareSuse
CVE-2004-0940 is a buffer overflow in the mod_include get_tag function in Apache HTTP Server 1.3.x through 1.3.32. An accidental double increment of a counter causes a length-check condition to fail to terminate the relevant parsing loop, resulting in an incorrect length calculation while processing SSI (XSSI) document content. The resulting out-of-bounds write can be used by a local user able to create SSI documents to execute arbitrary code in the web-server process context.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation enables arbitrary code execution with the privileges of the Apache HTTP Server service account. Exploitation may also crash or otherwise disrupt the affected web-server process, causing denial of service.
Mitigation
If you can’t patch tonight, do this now.
Disable mod_include where SSI processing is not required. Where it must remain enabled, restrict creation and modification of SSI documents to trusted administrators, prevent untrusted users from supplying SSI content, and monitor for anomalous SSI document activity.
Remediation
Patch, then assume compromise.
Upgrade affected Apache HTTP Server installations to a release that contains the mod_include fix. For affected F5 BIG-IP and 3-DNS products, upgrade to BIG-IP 4.5.12, 4.6.3, or later.
Exploits
No validated public exploits yet. Hidden: 2 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2004-0940 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2004-0940 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2004-0940?
- Yes. As of Oct 16, 2026, Mallory has reports of a public exploit for CVE-2004-0940.
- Is there a patch for CVE-2004-0940?
- Upgrade affected Apache HTTP Server installations to a release that contains the mod_include fix. For affected F5 BIG-IP and 3-DNS products, upgrade to BIG-IP 4.5.12, 4.6.3, or later.
- What products are affected by CVE-2004-0940?
- Apache Software Foundation Apache HTTP Server, Hewlett Packard Enterprise Hp-Ux, Openpkg, Trustix Secure Linux, Slackware Linux, and 1 more.
- How severe is CVE-2004-0940?
- CVE-2004-0940 has a CVSS v3.1 score of 7.8 (High) and an EPSS score of 4.8% (92nd percentile) as of Oct 16, 2026.
Recent activity
5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.