Skip to content

[Vulnerability] nodejs/node: Header Injection / Information Disclosure #62

Description

@github-actions

Potential Security Vulnerability Detected

Repository: nodejs/node
Commit: a6e9e32
Author: Node.js GitHub Bot
Date: 2026-03-02T00:49:33Z

Commit Message

deps: update undici to 7.22.0

PR-URL: https://github.com/nodejs/node/pull/62035
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>

Pull Request

PR: #62035 - deps: update undici to 7.22.0
Labels: lib / src, author ready, needs-ci, dependencies, dont-land-on-v20.x, dont-land-on-v22.x

Description:
This is an automated update of undici to 7.22.0.

Analysis

Vulnerability Type: Header Injection / Information Disclosure
Severity: Medium

Description

The cache interceptor was spreading result.vary headers directly into revalidation requests without filtering out null values. When a request header specified in the Vary header was absent from the original request, it was stored as null in the cache entry's vary map. Spreading this null value into the revalidation headers could corrupt the header object and potentially send unintended null-valued headers to the server. The patch adds a null-check guard so only present header values are forwarded during revalidation.

Affected Code

if (result.vary) {
  headers = {
    ...headers,
    ...result.vary
  }
}

Proof of Concept

// Server responds with Vary: accept-encoding
// Original request does NOT include accept-encoding header
// Cache stores vary = { 'accept-encoding': null }
// On revalidation, the spread { ...headers, ...result.vary } produces:
// { 'if-modified-since': '...', 'accept-encoding': null }
// Sending a request with a null-valued header could bypass server-side Vary matching
// or cause unexpected behavior in downstream servers/proxies that interpret null differently.
// Trigger: make a cached request without 'accept-encoding', wait for stale-while-revalidate,
// observe the revalidation request incorrectly includes 'accept-encoding: null'

This issue was automatically created by Vulnerability Spoiler Alert.
Detected at: 2026-03-02T00:50:37.134Z

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions