CVE-2022-25881
Description
This affects versions of the package http-cache-semantics before 4.1.1. The issue can be exploited via malicious request header values sent to a server, when that server reads the cache policy from the request using this library.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A regular expression denial of service (ReDoS) in http-cache-semantics before 4.1.1 allows attackers to crash servers via crafted request headers.
Vulnerability
Overview
CVE-2022-25881 is a Regular Expression Denial of Service (ReDoS) vulnerability in the http-cache-semantics library, affecting versions prior to 4.1.1. The library parses HTTP headers to determine cacheability according to RFC 7234. The issue stems from a vulnerable regular expression that can be forced into catastrophic backtracking when processing specially crafted request header values [2][3][4].
Exploitation
An attacker can exploit this vulnerability by sending a malicious HTTP request with crafted header values to a server that uses the vulnerable library to parse cache policy from incoming requests. The attack does not require authentication and can be executed over the network, making it remotely exploitable. The malicious header triggers the ReDoS, causing the server to consume excessive CPU resources [3][4].
Impact
Successful exploitation leads to a denial of service condition. The server becomes unresponsive or slow due to CPU exhaustion, potentially affecting all users relying on the service. The impact is limited to availability; there is no risk of data breach or privilege escalation [2][3][4].
Mitigation
The vulnerability is fixed in version 4.1.1 of http-cache-semantics. Users should upgrade immediately. No workarounds are available if the library is used to process untrusted request headers. The package has been widely used in the Node.js ecosystem, and users of affected versions should update as soon as possible [1][2].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
http-cache-semanticsnpm | < 4.1.1 | 4.1.1 |
org.webjars.npm:http-cache-semanticsMaven | < 4.1.1 | 4.1.1 |
Affected products
67- http-cache-semantics/http-cache-semanticsdescription
- osv-coords66 versionspkg:apk/chainguard/nodejs-14pkg:apk/chainguard/pgadmin4pkg:apk/chainguard/pgadmin4-oci-entrypointpkg:apk/chainguard/pgadmin4-pg12pkg:apk/chainguard/pgadmin4-pg13pkg:apk/chainguard/pgadmin4-pg14pkg:apk/chainguard/pgadmin4-pg15pkg:apk/chainguard/pgadmin4-pg16pkg:apk/chainguard/pgadmin4-pg17pkg:maven/org.webjars.npm/http-cache-semanticspkg:npm/http-cache-semanticspkg:rpm/almalinux/nodejspkg:rpm/almalinux/nodejs-develpkg:rpm/almalinux/nodejs-docspkg:rpm/almalinux/nodejs-full-i18npkg:rpm/almalinux/nodejs-libspkg:rpm/almalinux/nodejs-nodemonpkg:rpm/almalinux/nodejs-packagingpkg:rpm/almalinux/nodejs-packaging-bundlerpkg:rpm/almalinux/npmpkg:rpm/opensuse/nodejs10&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/nodejs12&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/nodejs14&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/nodejs16&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/nodejs18&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/nodejs18&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/nodejs18&distro=openSUSE%20Tumbleweedpkg:rpm/suse/nodejs10&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/nodejs10&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/nodejs10&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/nodejs10&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/nodejs10&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/nodejs10&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP1pkg:rpm/suse/nodejs10&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/nodejs12&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/nodejs12&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/nodejs12&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/nodejs12&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/nodejs12&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/nodejs12&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/nodejs12&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/nodejs12&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/nodejs12&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/nodejs12&distro=SUSE%20Manager%20Server%204.2pkg:rpm/suse/nodejs14&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/nodejs14&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/nodejs14&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/nodejs14&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/nodejs14&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/nodejs14&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2012pkg:rpm/suse/nodejs14&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/nodejs14&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/nodejs14&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/nodejs14&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/nodejs14&distro=SUSE%20Manager%20Server%204.2pkg:rpm/suse/nodejs16&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/nodejs16&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/nodejs16&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/nodejs16&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2012pkg:rpm/suse/nodejs16&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP4pkg:rpm/suse/nodejs16&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/nodejs16&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/nodejs16&distro=SUSE%20Manager%20Server%204.2pkg:rpm/suse/nodejs18&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2012pkg:rpm/suse/nodejs18&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP4pkg:rpm/suse/nodejs18&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP5
< 14.21.3-r1+ 65 more
- (no CPE)range: < 14.21.3-r1
- (no CPE)range: < 9.1-r1
- (no CPE)range: < 9.1-r1
- (no CPE)range: < 9.1-r1
- (no CPE)range: < 9.1-r1
- (no CPE)range: < 9.1-r1
- (no CPE)range: < 9.1-r1
- (no CPE)range: < 9.1-r1
- (no CPE)range: < 9.1-r1
- (no CPE)range: < 4.1.1
- (no CPE)range: < 4.1.1
- (no CPE)range: < 1:16.19.1-1.module_el8.7.0+3496+a59a3324
- (no CPE)range: < 1:16.19.1-1.module_el8.7.0+3496+a59a3324
- (no CPE)range: < 1:16.19.1-1.module_el8.7.0+3496+a59a3324
- (no CPE)range: < 1:16.19.1-1.module_el8.7.0+3496+a59a3324
- (no CPE)range: < 1:16.19.1-1.el9_2
- (no CPE)range: < 2.0.20-3.module_el8.7.0+3496+a59a3324
- (no CPE)range: < 25-1.module_el8.5.0+2605+45d748af
- (no CPE)range: < 2021.06-4.module_el8.7.0+3343+ea2b7901
- (no CPE)range: < 1:8.19.3-1.16.19.1.1.module_el8.7.0+3496+a59a3324
- (no CPE)range: < 10.24.1-150000.1.59.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 16.20.0-150400.3.18.2
- (no CPE)range: < 18.16.1-150400.9.9.1
- (no CPE)range: < 18.16.1-150400.9.9.1
- (no CPE)range: < 18.16.0-1.1
- (no CPE)range: < 10.24.1-150000.1.59.1
- (no CPE)range: < 10.24.1-150000.1.59.1
- (no CPE)range: < 10.24.1-150000.1.59.1
- (no CPE)range: < 10.24.1-150000.1.59.1
- (no CPE)range: < 10.24.1-150000.1.59.1
- (no CPE)range: < 10.24.1-150000.1.59.1
- (no CPE)range: < 10.24.1-150000.1.59.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 12.22.12-150200.4.47.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 14.21.3-6.43.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 14.21.3-150200.15.46.1
- (no CPE)range: < 16.20.0-150300.7.21.2
- (no CPE)range: < 16.20.0-150300.7.21.2
- (no CPE)range: < 16.20.0-150300.7.21.2
- (no CPE)range: < 16.20.0-8.27.1
- (no CPE)range: < 16.20.0-150400.3.18.2
- (no CPE)range: < 16.20.0-150300.7.21.2
- (no CPE)range: < 16.20.0-150300.7.21.2
- (no CPE)range: < 16.20.0-150300.7.21.2
- (no CPE)range: < 18.16.1-8.9.1
- (no CPE)range: < 18.16.1-150400.9.9.1
- (no CPE)range: < 18.16.1-150400.9.9.1
Patches
1560b2d8ef452Don't use regex to trim whitespace
2 files changed · +4 −4
index.js+3 −3 modified@@ -80,10 +80,10 @@ function parseCacheControl(header) { // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives), // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale - const parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing + const parts = header.trim().split(/,/); for (const part of parts) { - const [k, v] = part.split(/\s*=\s*/, 2); - cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting + const [k, v] = part.split(/=/, 2); + cc[k.trim()] = v === undefined ? true : v.trim().replace(/^"|"$/g, ''); } return cc;
package.json+1 −1 modified@@ -1,6 +1,6 @@ { "name": "http-cache-semantics", - "version": "4.1.0", + "version": "4.1.1", "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies", "repository": "https://github.com/kornelski/http-cache-semantics.git", "main": "index.js",
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- github.com/advisories/GHSA-rc47-6667-2j5jghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-25881ghsaADVISORY
- github.com/kornelski/http-cache-semantics/blob/master/index.js%23L83ghsaWEB
- github.com/kornelski/http-cache-semantics/commit/560b2d8ef452bbba20ffed69dc155d63ac757b74ghsaWEB
- security.netapp.com/advisory/ntap-20230622-0008ghsaWEB
- security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-3253332ghsaWEB
- security.snyk.io/vuln/SNYK-JS-HTTPCACHESEMANTICS-3248783ghsaWEB
- security.netapp.com/advisory/ntap-20230622-0008/mitre
News mentions
0No linked articles in our index yet.