Back to Blog
high SEVERITY5 min read

How Cache-Control Header Parsing Vulnerabilities Happen in Node.js HTTP Clients and How to Fix Them

A high-severity vulnerability (CVE-2026-13697) was discovered in undici, the popular Node.js HTTP client, where malformed Cache-Control directives could lead to information disclosure and denial of service. The cache interceptor failed to properly validate the `private` directive in Cache-Control headers, potentially exposing sensitive cached data. This fix upgrades undici to versions 7.29.0 and 8.9.0 to address the parsing flaw.

O
By Orbis AppSec
•Technically reviewed by Anupam Mediratta•Published August 19, 2026•Reviewed August 19, 2026

Answer Summary

CVE-2026-13697 is a high-severity information disclosure and denial of service vulnerability in undici, a Node.js HTTP client library. The flaw exists in undici's cache interceptor, which mishandles malformed Cache-Control `private` directives, potentially exposing cached responses to unauthorized parties. The fix involves upgrading undici to version 7.29.0 or 8.9.0, which properly validates Cache-Control header parsing to prevent cache poisoning attacks.

Vulnerability at a Glance

cweCWE-444 (Inconsistent Interpretation of HTTP Requests)
fixUpgrade undici to 7.29.0 or 8.9.0
riskSensitive cached data exposure and service disruption
languageJavaScript/Node.js
root causeMalformed Cache-Control private directive not properly validated
vulnerabilityCache-Control Header Parsing / Information Disclosure

Introduction

The package-lock.json file in this repository declared undici as a dependency—a high-performance HTTP/1.1 client that powers many Node.js applications' networking capabilities. However, a critical flaw lurked in undici's cache interceptor: when processing Cache-Control headers containing malformed private directives, the parser failed to properly reject or handle the invalid input.

This vulnerability, tracked as CVE-2026-13697, meant that an attacker could craft HTTP responses with specially malformed Cache-Control headers to either extract information from the cache that should have remained private, or trigger a denial of service condition. For applications using undici's caching features to improve performance, this created an unexpected attack surface where the very mechanism designed to optimize responses became a liability.

The Vulnerability Explained

What Went Wrong in Undici's Cache Interceptor

HTTP caching relies heavily on the Cache-Control header to determine how responses should be stored and served. The private directive specifically indicates that a response is intended for a single user and must not be stored by shared caches. When this directive is malformed—perhaps through extra characters, improper quoting, or unexpected formatting—a robust parser should either reject the header entirely or fail safely.

Undici's cache interceptor, prior to versions 7.29.0 and 8.9.0, did not properly handle these edge cases. The malformed private directive parsing could result in:

  1. Information Disclosure: Responses marked as private might be incorrectly cached and served to other users
  2. Denial of Service: Malformed headers could cause parsing errors that disrupt normal cache operations

Attack Scenario

Consider an application using undici to fetch user-specific data from an API:

import { request, cacheInterceptor } from 'undici';

const client = new Client('https://api.example.com', {
  interceptors: [cacheInterceptor()]
});

// Fetch user-specific dashboard data
const response = await client.request({
  path: '/api/user/dashboard',
  method: 'GET',
  headers: { 'Authorization': `Bearer ${userToken}` }
});

An attacker controlling a malicious upstream server (or performing a man-in-the-middle attack) could return a response with a malformed Cache-Control header:

HTTP/1.1 200 OK
Cache-Control: private="malformed\x00value", max-age=3600
Content-Type: application/json

{"user": "alice", "balance": "$10,000", "ssn": "123-45-6789"}

With the vulnerable undici version, this malformed private directive might be misinterpreted, causing the sensitive response to be cached and potentially served to other users making similar requests.

The Fix

The fix involved upgrading undici from version 7.28.0 to 7.29.0 (and ensuring compatibility with 8.9.0). Looking at the package-lock.json changes, we can see the dependency tree was restructured:

Before (Vulnerable)

{
  "integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==",
  "devOptional": true,
  "license": "MIT",
  "peer": true,
  "engines": {
    "node": ">= 20.19.0"
  }
}

After (Fixed)

{
  "integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==",
  "devOptional": true,
  "license": "MIT",
  "engines": {
    "node": ">= 20.19.0"
  }
}

The diff shows several changes to the dependency resolution:

  1. Removed peer: true flags from multiple packages including undici itself, ensuring the fixed version is directly installed rather than relying on peer dependency resolution
  2. Added peer: true flags to optional dependencies like fsevents and fs-extra to properly isolate them
  3. Updated the dependency tree to ensure the patched undici version is resolved consistently

These changes ensure that:
- The application uses the fixed undici version directly
- The cache interceptor now properly validates Cache-Control directives
- Malformed private values are rejected or handled safely

Key Takeaways

  • Undici's cache interceptor required specific validation for malformed Cache-Control private directives—a parsing edge case that created both information disclosure and DoS risks
  • The peer: true flag changes in package-lock.json ensured direct dependency resolution rather than relying on potentially vulnerable peer versions
  • HTTP header parsing is security-critical—even well-established libraries can have subtle parsing flaws that create exploitable conditions
  • Dependency scanning tools like Trivy caught this CVE before it could be exploited in production, demonstrating the value of automated security scanning
  • Cache-related vulnerabilities can have severe privacy implications when user-specific data is incorrectly shared between requests

How Orbis AppSec Detected This

  • Source: HTTP response headers from upstream servers, specifically the Cache-Control header value
  • Sink: undici's cache interceptor parsing logic that processes and stores responses based on Cache-Control directives
  • Missing control: Proper validation and rejection of malformed private directive values in Cache-Control headers
  • CWE: CWE-444 (Inconsistent Interpretation of HTTP Requests)
  • Fix: Upgraded undici from 7.28.0 to 7.29.0/8.9.0, which includes proper validation of Cache-Control header parsing

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.

Conclusion

CVE-2026-13697 serves as a reminder that even fundamental HTTP operations like cache header parsing require rigorous validation. The undici library is widely used across the Node.js ecosystem, making this vulnerability particularly impactful. By upgrading to the patched versions (7.29.0 or 8.9.0) and implementing defense-in-depth caching strategies, developers can protect their applications from both this specific vulnerability and similar header parsing issues in the future.

Always treat HTTP headers as untrusted input, even when they come from seemingly trusted sources. Malformed headers can slip through at any point in the request chain, and your application's parsing logic must be prepared to handle them safely.

Prevention and further reading

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #9

Related Articles

critical

Lampa Desktop Auto-Update Heuristic Bypass: Execution of Unverified

Lampa Desktop's auto-update mechanism downloaded JavaScript and CSS from `raw.githubusercontent.com` using only heuristic validation—file size thresholds and string pattern matching—that attackers could trivially satisfy. The fix introduces cryptographic integrity verification by cross-referencing Git blob hashes from the GitHub Contents API, ensuring downloaded code matches the repository's authoritative state before execution.

high

adm-zip 0.6.0 Preserves SUID Bits From ZIPs: CVE-2026-102282

The `adm-zip` dependency resolved to 0.6.0 in this project's dependency tree, a version affected by CVE-2026-102282: during extraction it applies the Unix permission bits stored in each ZIP entry's external file attributes verbatim, including the setuid (`04000`), setgid (`02000`), and sticky bits. An attacker who controls an archive passed to `extractAllTo()` or `extractEntryTo()` can therefore have the extractor create a setuid binary owned by whatever user the extraction process runs as. The

high

requestInput() Type Confusion: NaN and Object Bypass in JavaScript

The `requestInput()` utility function lacked validation on its `type` parameter and failed to handle `NaN` results from float conversions, creating a type confusion weakness. An attacker could supply malformed inputs that propagate unhandled `NaN` values or unexpected object types through the type system. The fix adds explicit guards against `NaN` type parameters and rejects non-primitive type values.

critical

No Rate Limit on /api/uploads/presign Enables DoS

The `/api/uploads/presign` endpoint accepted unlimited concurrent requests to generate storage presigned URLs, giving an attacker a free lever to exhaust storage-provider quotas and server resources. The fix adds an `express-rate-limit` middleware capping each client to 30 requests per minute on that route.

high

CVE-2026-54673: builder-util-runtime Leaks Auth Headers on Redirect

electron-updater and electron-builder rely on builder-util-runtime to fetch update manifests and artifacts over HTTP. A flaw in that shared HTTP executor allowed credential headers attached to the original update-feed request to be re-sent after a redirect, exposing them to any host the redirect pointed to. The project fixes this by upgrading builder-util-runtime to 9.7.0 and collapsing a duplicate, older copy of the package that electron-updater had pinned on its own.

high

image-size 1.2.1 DoS: Zero-Valued Dimensions in Image Buffer Parser

A high-severity denial-of-service vulnerability in image-size 1.2.1 allows attackers to crash Node.js services using malicious image buffers with zero-valued dimensions. The fix removes the vulnerable `queue` dependency and tightens dimension validation in version 2.0.3.