Vulnerabilities in pkg:npm/on-headers

PACKAGE
Advisory Identifier: GHSA-76c9-3jph-rj3q
Advisory Summary

CVE-2025-7339 is a LOW (CVSS 3.4) on-headers is vulnerable to http vulnerability (CWE-241: Improper Handling of Unexpected Data Type) affecting On headers libraries in the npm ecosystem. The issue involves on-headers is vulnerable to http response header manipulation. Remediation is available by upgrading affected packages to version 1.1.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/on-headers

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/on-headers. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-76c9-3jph-rj3q CVE-2025-7339 LOW on-headers is vulnerable to http response header manipulation

CVE-2025-7339 at a Glance

CVE Identifier CVE-2025-7339
GHSA Identifier GHSA-76c9-3jph-rj3q
Severity LOW
CVSS v3.1 Base Score 3.4
CWE Classification CWE-241: Improper Handling of Unexpected Data Type
Affected Product On headers
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-7339

To remediate this vulnerability, upgrade all affected On headers dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

on-headers fixed: 1.1.0
npm install on-headers@1.1.0
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 on-headers

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-7339, inspect your project dependencies using npm:

npm ls on-headers

Analyze the terminal output to locate any version of On headers in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.0), your application is affected.

Note: The npm ls on-headers 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-241: Improper Handling of Unexpected Data Type, where the product does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (a-z). In On headers, 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

### Impact A bug in on-headers versions `< 1.1.0` may result in response headers being inadvertently modified when an array is passed to `response.writeHead()` ### Patches Users should upgrade to `1.1.0` ### Workarounds Uses are encouraged to upgrade to `1.1.0`, but this issue can be worked around by passing an object to `response.writeHead()` rather than an array.

CVE-2025-7339 Affected On headers Versions

1 component(s)
Fixed Versions:
1.1.0
Product / Package Ecosystem Affected Versions Fixed Version
on-headers
npm
< 1.1.0
1.1.0

References

Frequently Asked Questions

What is CVE-2025-7339?
CVE-2025-7339 is a security vulnerability in On headers involving on-headers is vulnerable to http response header manipulation under CWE-241: Improper Handling of Unexpected Data Type.
Which On headers versions are affected?
Affected versions include releases prior to 1.1.0 across affected packages: on-headers.
What version fixes CVE-2025-7339?
Upgrading to 1.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is on-headers affected?
Yes, on-headers is affected in releases prior to 1.1.0. Upgrade your dependency to 1.1.0 or later.
What is the CVSS score of CVE-2025-7339?
CVE-2025-7339 has a CVSS v3.1 base score of 3.4 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2025-7339?
CVE-2025-7339 is classified under CWE-241: Improper Handling of Unexpected Data Type (The product does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (A-Z).).
How can I check npm dependencies for CVE-2025-7339?
Run the dependency tree command: 'npm ls on-headers'. 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-76c9-3jph-rj3q",
  "modified" : "2025-07-17T21:17:19Z",
  "published" : "2025-07-17T21:17:19Z",
  "aliases" : [ "CVE-2025-7339" ],
  "summary" : "on-headers is vulnerable to http response header manipulation",
  "details" : "### Impact\n\nA bug in on-headers versions `< 1.1.0` may result in response headers being inadvertently modified when an array is passed to `response.writeHead()`\n\n### Patches\n\nUsers should upgrade to `1.1.0`\n\n### Workarounds\n\nUses are encouraged to upgrade to `1.1.0`, but this issue can be worked around by passing an object to `response.writeHead()` rather than an array.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "on-headers"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jshttp/on-headers/security/advisories/GHSA-76c9-3jph-rj3q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-7339"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/expressjs/morgan/issues/315"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jshttp/on-headers/issues/15"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jshttp/on-headers/commit/c6e384908c9c6127d18831d16ab0bd96e1231867"
  }, {
    "type" : "WEB",
    "url" : "https://cna.openjsf.org/security-advisories.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jshttp/on-headers"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-241" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-17T21:17:19Z",
    "nvd_published_at" : "2025-07-17T16:15:35Z"
  }
}