Vulnerabilities in pkg:maven/org.webjars.npm/http-cache-semantics
PACKAGECVE-2022-25881 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Http cache semantics libraries in the npm ecosystem. The issue involves http-cache-semantics vulnerable to regular expression denial of service. Remediation is available by upgrading affected packages to version 4.1.1.
pkg:maven/org.webjars.npm/http-cache-semantics
Vulnerability advisories affecting package pkg:maven/org.webjars.npm/http-cache-semantics. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-rc47-6667-2j5j | CVE-2022-25881 | HIGH | http-cache-semantics vulnerable to Regular Expression Denial of Service |
CVE-2022-25881 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-25881
To remediate this vulnerability, upgrade all affected Http cache semantics dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install http-cache-semantics@4.1.1
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>http-cache-semantics</artifactId>
<version>4.1.1</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls http-cache-semantics
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-25881, inspect your project dependencies using npm:
npm ls http-cache-semantics
Analyze the terminal output to locate any version of Http cache semantics in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.1), your application is affected.
Note: The npm ls http-cache-semantics command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Http cache semantics, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-25881 Affected Http cache semantics Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
http-cache-semantics
|
npm |
< 4.1.1
|
4.1.1
|
|
org.webjars.npm:http-cache-semantics
|
Maven |
< 4.1.1
|
4.1.1
|
References
Frequently Asked Questions
What is CVE-2022-25881?
Which Http cache semantics versions are affected?
What version fixes CVE-2022-25881?
Is http-cache-semantics affected?
What is the CVSS score of CVE-2022-25881?
What CWE is associated with CVE-2022-25881?
How can I check npm dependencies for CVE-2022-25881?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rc47-6667-2j5j",
"modified" : "2025-02-13T18:36:37Z",
"published" : "2023-01-31T06:30:26Z",
"aliases" : [ "CVE-2022-25881" ],
"summary" : "http-cache-semantics vulnerable to Regular Expression Denial of Service",
"details" : "http-cache semantics contains an Inefficient Regular Expression Complexity , leading to Denial of Service. 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "http-cache-semantics"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.webjars.npm:http-cache-semantics"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-25881"
}, {
"type" : "WEB",
"url" : "https://github.com/kornelski/http-cache-semantics/commit/560b2d8ef452bbba20ffed69dc155d63ac757b74"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/kornelski/http-cache-semantics"
}, {
"type" : "WEB",
"url" : "https://github.com/kornelski/http-cache-semantics/blob/master/index.js%23L83"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20230622-0008"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-3253332"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JS-HTTPCACHESEMANTICS-3248783"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-02-01T23:48:07Z",
"nvd_published_at" : "2023-01-31T05:15:00Z"
}
}