CVE-2025-7339 Details
Description
on-headers is a node.js middleware for listening to when a response writes headers. 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()`. Users should upgrade to version 1.1.0 to receive a patch. Uses are strongly 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.
A vulnerability exists in the on-headers Node.js middleware, specifically in versions prior to 1.1.0. This issue can lead to unintended modifications of HTTP response headers when an array is passed to the response.writeHead() method. The vulnerability arises because the setHeadersFromArray function incorrectly interprets the array as a 2D structure, rather than the expected 1D format. This problem is exacerbated when the middleware is used in conjunction with other libraries that rely on proper header formatting, such as morgan.
Users are advised to upgrade to on-headers version 1.1.0, which includes a patch for this vulnerability. The issue can also be temporarily mitigated by passing an object to the response.writeHead() method instead of an array.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jul 17, 2025CISA-ADP
Assessed Jul 17, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://cna.openjsf.org/security-advisories.html | openjs | AdvisoryBundle |
| https://github.com/expressjs/morgan/issues/315 | openjs | ExploitIssue TrackingTechnical DescriptionVendor |
| https://github.com/jshttp/on-headers/commit/c6e384908c9c6127d18831d16ab0bd96e1231867 | openjs | Source CodeVendor |
| https://github.com/jshttp/on-headers/issues/15 | openjs | Issue TrackingTechnical DescriptionVendor |
| https://github.com/jshttp/on-headers/security/advisories/GHSA-76c9-3jph-rj3q | openjs | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-241 | Improper Handling of Unexpected Data Type | openjs |
Affected Products
| Product | Versions |
|---|---|
| jshttp on-headers | All versions |
CPE
Remediation
| |
| expressjs morgan | All versions |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | openjs |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jul 17, 2025 | New CVE Received | openjs |
Volerion