Skip to content

GHSA-76c9-3jph-rj3q CVE-2025-7339

on-headers is vulnerable to http response header manipulation

Low npm
Severity
3.4 / 10
Low · CVSS 3.1
Exploit chance (EPSS)
0.21%
Chance of exploitation in the next 30 days. Higher than 10.90% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-241 Improper Handling of Unexpected Data Type
Fix
1.1.0
Upgrade on-headers to this version or later

Description

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.

Affected versions

npm

PackageVulnerableFixed in
on-headers
< 1.1.0
1.1.0
on-headers
< 1.1.0
1.1.0

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

on-headers npm → 1.1.0

npm
npm install on-headers@1.1.0
yarn
yarn add on-headers@1.1.0
pnpm
pnpm add on-headers@1.1.0

Severity breakdown

CVSS 3.1 3.4

CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N

Attack vector
Local
Attack complexity
Low
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

Weakness

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 to prevent it
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • Implementation: Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-xh29-r2w5-wx8m
Nokogiri Improperly Handles Unexpected Data Type
High Same weakness, CWE-241

Credits: SPodjasek, UlisesGascon, Zen-cronic, ctcpip, jonchurch, sheplu

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor