Critical Vulnerability in node-on-headers: Header Modification Risk

node-on-headers Updated 02 Oct 2025

Summary

17/07/2025
N/A
No i
Unrated
Not published

CVE-2025-7339: on-headers is a node.js middleware for listening to when a response writes headers. A bug in on-headers versions. Affects node-on-headers versions < c6e384908c9c6127d18831d16ab0bd96e1231867. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

node-on-headers is a middleware for Node.js that allows developers to listen for when a response writes headers. It is commonly used in web applications to manage HTTP responses effectively. The package is designed to enhance the functionality of HTTP headers, but it has a vulnerability that can lead to unintended modifications of response headers when certain data types are passed to the response methods.

Vulnerability Detail

The vulnerability, identified as CVE-2025-7339, affects versions of node-on-headers prior to 1.1.0. The issue arises when an array is passed to the response.writeHead() method, which can inadvertently modify the response headers. This can lead to unexpected behavior in web applications, potentially exposing sensitive information or causing incorrect responses to be sent to clients.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, users can avoid passing arrays to the

response.writeHead() method. Instead, they should pass an object. For example: response.writeHead(200, { 'Content-Type': 'application/json' });

Conclusion

The vulnerability CVE-2025-7339 in the node-on-headers package poses a significant risk by allowing unintended modifications of HTTP response headers. Users are strongly encouraged to upgrade to version 1.1.0 to mitigate this risk. Temporary workarounds are available, but they do not replace the need for a proper fix.

See every vulnerability recorded for node-on-headers →

Share this vulnerability

FAQ

CVE-2025-7339 is a vulnerability in the node-on-headers package that can lead to unintended modifications of HTTP response headers.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Not fixing this vulnerability can lead to unexpected behavior in web applications, including the potential exposure of sensitive information.

Yes, a patch is available in version 1.1.0 of the node-on-headers package.

If an immediate upgrade is not possible, you can implement a workaround by passing an object instead of an array to the response.writeHead() method.

Related vulnerabilities

Recent vulnerabilities recorded for node-on-headers.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback