Vulnerabilities in pkg:maven/org.webjars.npm/http-cache-semantics

PACKAGE
Advisory Identifier: GHSA-rc47-6667-2j5j
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.webjars.npm/http-cache-semantics

1 Known Advisory Record(s)

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

CVE Identifier CVE-2022-25881
GHSA Identifier GHSA-rc47-6667-2j5j
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Http cache semantics
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (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.

http-cache-semantics fixed: 4.1.1
npm install http-cache-semantics@4.1.1
org.webjars.npm:http-cache-semantics fixed: 4.1.1
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>http-cache-semantics</artifactId>
    <version>4.1.1</version>
</dependency>
Verify Direct and Transitive Dependencies

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

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.

CVE-2022-25881 Affected Http cache semantics Versions

2 component(s)
Fixed Versions:
4.1.1
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?
CVE-2022-25881 is a security vulnerability in Http cache semantics involving http-cache-semantics vulnerable to Regular Expression Denial of Service under CWE-1333: Inefficient Regular Expression Complexity.
Which Http cache semantics versions are affected?
Affected versions include releases prior to 4.1.1 across affected packages: http-cache-semantics, org.webjars.npm:http-cache-semantics.
What version fixes CVE-2022-25881?
Upgrading to 4.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is http-cache-semantics affected?
Yes, http-cache-semantics is affected in releases prior to 4.1.1. Upgrade your dependency to 4.1.1 or later.
What is the CVSS score of CVE-2022-25881?
CVE-2022-25881 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-25881?
CVE-2022-25881 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check npm dependencies for CVE-2022-25881?
Run the dependency tree command: 'npm ls http-cache-semantics'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}