Skip to content

[Snyk] Upgrade undici from 7.28.0 to 8.7.0 - #61

Open
Aravind-Kumar-cstk wants to merge 1 commit into
masterfrom
snyk-upgrade-0a5bf30983234484ae8dc219901e4548
Open

[Snyk] Upgrade undici from 7.28.0 to 8.7.0#61
Aravind-Kumar-cstk wants to merge 1 commit into
masterfrom
snyk-upgrade-0a5bf30983234484ae8dc219901e4548

Conversation

@Aravind-Kumar-cstk

Copy link
Copy Markdown
Contributor

snyk-top-banner

Snyk has created this PR to upgrade undici from 7.28.0 to 8.7.0.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 13 versions ahead of your current version.

  • The recommended version was released 22 days ago.

Breaking Change Risk

Merge Risk: High

Notice: This assessment is enhanced by AI.

Release notes
Package name: undici
  • 8.7.0 - 2026-07-04

    What's Changed

    • test: guard balanced-pool error port lookup by @ mcollina in #5463
    • perf: optimize http/2 request hot path by @ mcollina in #5483
    • fix: do not reject open-ended Range values in simpleRangeHeaderValue by @ spokodev in #5490
    • fix(eventsource): set use-URL-credentials flag by @ Ram-blip in #5489
    • test: deflake connect-timeout watchdog by @ mcollina in #5197
    • docs: correct npm script name and JSON syntax in examples by @ lenoxfernando in #5496
    • fix: reject non-ascii octets in validateCookiePath by @ spokodev in #5452
    • fix(readable): ignore late consume chunks by @ marko1olo in #5375
    • fix(h2): destroy the stream on abort instead of relying on close() by @ staylor in #5462
    • fix: ignore an unparseable Set-Cookie Expires attribute by @ spokodev in #5488
    • docs: add reproduction guide and update bug report template by @ mcollina in #5451
    • fix(h2): guard onResponse against a 'response' event delivered after completion by @ staylor in #5440
    • fix(h2): requeue request on GOAWAY'd session instead of crashing by @ staylor in #5453
    • fix: add static buildDispatch method to RedirectHandler type definition by @ matthieusieben in #5442
    • fix: auto-detect HTTP proxy tunneling by @ mcollina in #5116

    New Contributors

    Full Changelog: v8.6.0...v8.7.0

  • 8.6.0 - 2026-07-02

    What's Changed

    • build(deps-dev): bump proxy from 4.0.0 to 4.1.0 by @ dependabot[bot] in #5433
    • update accept-encoding header in fetch by @ KhafraDev in #5439
    • fix: drop response chunks after the response stream is destroyed (#5356) by @ cesarvspr in #5357
    • fix: handle incomplete multi-byte UTF-8 sequences in setEncoding() by @ joecwu in #5003
    • fix(retry): keep flow-control wired to the active connection across resumes by @ bogomya in #5405
    • test: cover connect lookup option by @ vibhor-aggr in #5411
    • test: fail on unexpected reconnect disconnect by @ vibhor-aggr in #5412
    • build(deps-dev): bump esbuild from 0.28.0 to 0.28.1 by @ dependabot[bot] in #5419
    • fix(proxy): fail the request when the CONNECT tunnel drops instead of looping by @ cesarvspr in #5441
    • feat(docs): migrate to doc-kit by @ avivkeller in #5438
    • build(deps-dev): bump undici from 6.25.0 to 6.27.0 by @ dependabot[bot] in #5445
    • fetch: fix issue 4058 by @ KhafraDev in #5456
    • docs: add Interceptors API reference page by @ enjoykumawat in #5446
    • Document H1 keep-alive trust tradeoff by @ mcollina in #5457
    • fix(h2): deliver an early final response to an Expect: 100-continue request by @ jeswr in #5470
    • fix(types): correct deleteCookie attributes by @ Ram-blip in #5461
    • fix(h1): complete paused parser on socket end instead of crashing by @ ronag in #5474
    • build(deps): bump github/codeql-action/init from 4.36.1 to 4.36.2 by @ dependabot[bot] in #5476
    • build(deps): bump github/codeql-action/upload-sarif from 4.36.1 to 4.36.2 by @ dependabot[bot] in #5481
    • build(deps): bump fastify/github-action-merge-dependabot from 3.12.0 to 3.15.0 by @ dependabot[bot] in #5480
    • build(deps): bump codecov/codecov-action from 6.0.1 to 7.0.0 by @ dependabot[bot] in #5478
    • build(deps): bump actions/checkout from 6.0.3 to 7.0.0 by @ dependabot[bot] in #5482
    • build(deps): bump github/codeql-action from 4.36.1 to 4.36.2 by @ trivikr in #5484
    • build(deps): bump github/codeql-action/analyze from 4.36.1 to 4.36.2 by @ dependabot[bot] in #5477
    • feat: support HTTP QUERY method (RFC 10008) by @ mcollina in #5459
    • fix: requeue h2 requests after goaway by @ mcollina in #5473

    New Contributors

    Full Changelog: v8.5.0...v8.6.0

  • 8.5.0 - 2026-06-15

    ⚠️ Security Release

    This release line addresses 8 security advisories. Most are fixed in
    v8.5.0; the SOCKS5 pool-reuse issue was fixed earlier in v8.2.0.

    Action required: Upgrade to undici 8.5.0 or later.

    npm install undici@^8.5.0

    Summary

    Advisory CVE Severity (CVSS) Fixed in Fix commit
    GHSA-vxpw-j846-p89q CVE-2026-12151 High (7.5) 8.5.0 32dbf0b3
    GHSA-38rv-x7px-6hhq CVE-2026-9675 High (7.5) 8.5.0 b4c287b3
    GHSA-vmh5-mc38-953g CVE-2026-9697 High (7.4) 8.5.0 42d49559
    GHSA-hm92-r4w5-c3mj CVE-2026-6734 High (7.5) 8.2.0 a516f870
    GHSA-pr7r-676h-xcf6 CVE-2026-9678 Moderate (5.9) 8.5.0 cb105d7c
    GHSA-p88m-4jfj-68fv CVE-2026-9679 Moderate (5.9) 8.5.0 5655ea43
    GHSA-g8m3-5g58-fq7m CVE-2026-11525 Low (3.7) 8.5.0 5655ea43
    GHSA-35p6-xmwp-9g52 CVE-2026-6733 Low (3.7) 8.5.0 6ea54ef8

    High severity

    WebSocket DoS via fragment count bypass — CVE-2026-12151

    GHSA-vxpw-j846-p89q · CWE-400, CWE-770
    Fix: 32dbf0b3 websocket: limit the number of fragments in a message (also c5ed7875 handle empty fragments and stream limits)

    A malicious WebSocket server can stream a large number of small or empty
    continuation frames. Undici enforced a limit on cumulative payload size but did
    not limit the number of fragments per message, leading to unbounded memory
    growth and denial of service.

    • Affected: applications using new WebSocket(...) or WebSocketStream
      against untrusted endpoints.
    • Workaround: none — upgrade is required.

    WebSocket DoS via cumulative fragment bypass — CVE-2026-9675

    GHSA-38rv-x7px-6hhq · CWE-400, CWE-770
    Fix: b4c287b3 fix(websocket): enforce max payload size across fragments

    Undici validated the size of individual frames but did not track cumulative size
    across a fragmented message. An attacker could send many small fragments that
    each pass per-frame validation but collectively exceed the configured limit,
    causing memory exhaustion. This is a regression introduced in 8.1.0 (the
    6.x and 7.x lines are not affected).

    • Workaround: none — upgrade is required.

    TLS certificate validation bypass in SOCKS5 ProxyAgent — CVE-2026-9697

    GHSA-vmh5-mc38-953g · CWE-295
    Fix: 42d49559 fix: honor requestTls when proxy is SOCKS5

    The ProxyAgent silently discarded the requestTls option when configured with
    a SOCKS5 proxy. TLS connections through the SOCKS5 tunnel ignored user-configured
    parameters such as ca, cert, key, rejectUnauthorized, and servername,
    falling back to the default Mozilla CA bundle. Applications relying on
    certificate pinning to an internal CA were exposed to man-in-the-middle attacks.

    • Affected: ProxyAgent / Socks5ProxyAgent over SOCKS5 that rely on
      requestTls.
    • Workaround: route traffic through an HTTP-proxy ProxyAgent, where
      requestTls functions correctly.

    Cross-origin request routing via SOCKS5 proxy pool reuse — CVE-2026-6734

    GHSA-hm92-r4w5-c3mj · CWE-346 · Fixed in 8.2.0
    Fix: a516f870 fix(socks5-proxy-agent): use per-origin pools to prevent cross-origin routing (#5041)

    Socks5ProxyAgent reused a single connection pool across different origins
    without verifying the pool's origin matched the requested origin. This could
    route credentials and request data to unintended destinations, cause responses
    from the wrong origin to be trusted, and enable HTTPS→HTTP downgrade.

    • Affected: applications using Socks5ProxyAgent across multiple origins
      (introduced via #4385).
    • Workaround: use a separate agent instance per origin.

    Moderate severity

    Cross-user information disclosure via shared cache whitespace bypass — CVE-2026-9678

    GHSA-pr7r-676h-xcf6 · CWE-524
    Fix: cb105d7c fix(cache): trim qualified field names

    The cache interceptor mishandled responses with whitespace-padded
    Cache-Control directives such as private=" authorization". In shared-cache
    mode this could cause authenticated data to be cached and served to other users.

    • Affected: apps using the cache interceptor in shared mode that forward
      Authorization upstream and receive non-canonical qualified directives.
    • Workaround: disable shared-cache mode for authenticated traffic, avoid
      caching authenticated responses, or add Vary: Authorization upstream.

    HTTP header injection via Set-Cookie percent-decoding — CVE-2026-9679

    GHSA-p88m-4jfj-68fv · CWE-93
    Fix: 5655ea43 fix(cookies): preserve values and parse SameSite strictly

    parseSetCookie applied percent-decoding to cookie values, turning encoded
    sequences like %0D%0A and %00 into literal bytes, contrary to RFC 6265 §5.4
    and browser behavior. Applications forwarding parsed Set-Cookie values into
    response headers were exposed to header injection, enabling session fixation,
    open redirects, and cache poisoning. Introduced in 7.0.0 via
    #3789.

    • Workaround: sanitize values before forwarding — strip or reject CR, LF,
      NUL, ;, and =.

    Low severity

    Set-Cookie SameSite attribute downgrade — CVE-2026-11525

    GHSA-g8m3-5g58-fq7m · CWE-183
    Fix: 5655ea43 fix(cookies): preserve values and parse SameSite strictly

    The cookie parser accepted SameSite values containing Strict, Lax, or
    None as substrings rather than requiring exact matches per RFC 6265. Values
    like SameSite=NoneOfYourBusiness parsed as None, and SameSite=StrictLax
    parsed as Lax, silently weakening cookie security policies for apps that
    forward parsed attributes.

    HTTP response queue poisoning via keep-alive socket reuse — CVE-2026-6733

    GHSA-35p6-xmwp-9g52 · CWE-367 (TOCTOU race condition)
    Fix: 6ea54ef8 fix: guard idle socket validation to skip fresh sockets, hardened by c9fbe9d2 keep idle validation on native timers (#5397) and ac5394b8 keep idle validation on global timers (#5407)

    An attacker controlling an upstream HTTP/1.1 server could inject unsolicited
    responses onto idle keep-alive sockets. On socket reuse, the injected response
    was associated with a new request, delivering responses to the wrong requests.

    • Requirements: attacker-controlled/compromised upstream and active
      keep-alive reuse.
    • Workaround: disable keep-alive reuse with keepAliveTimeout: 0 on the
      Client or Pool.

    Also in v8.5.0 (non-security)

    v8.5.0 shipped the security fixes above alongside the following changes. These
    are not security fixes
    — they are listed for completeness of the release. (The
    two queue-poisoning hardening PRs, #5397
    and #5407, are covered under
    CVE-2026-6733 above and are not repeated here.)

    • HTTP/2: #5408 don't rewind kPendingIdx past in-flight requests · #5391 allow h2 POST request multiplexing · #5406 reap idle HTTP/2 sessions · #5410 preserve h2 queue on out-of-order completion
    • Features: #5416 add bodyMixin.textStream() · #5418 align EventSource with spec
    • Docs / CI / tests: #5413 document request header validation · #5383 absorb h2 stream timeout resets (test) · #5420 remove stale repro + lint · #5426 extend Windows CI timeout · #5427 detect available python in WPT runner

    Full changelog: v8.4.1...v8.5.0.


    Credits

    Per-advisory credits (as recorded in each GHSA):

  • 8.4.1 - 2026-06-08

    What's Changed

    New Contributors

    Full Changelog: v8.4.0...v8.4.1

  • 8.4.0 - 2026-06-06

    What's Changed

    • fix: register connect listener before initiating requests in close-and-destroy test by

Snyk has created this PR to upgrade undici from 7.28.0 to 8.7.0.

See this package in npm:
undici

See this project in Snyk:
https://app.snyk.io/org/contentstack-devex/project/3ff4bdb1-6dfb-40a1-8a29-d4eb9538efe1?utm_source=github&utm_medium=referral&page=upgrade-pr
@Aravind-Kumar-cstk

Copy link
Copy Markdown
Contributor Author

Merge Risk: High

This major version upgrade from undici v7 to v8 introduces significant breaking changes, including a new minimum Node.js version and API modifications.

Key Breaking Changes:

  • Node.js Version: Undici v8 requires Node.js version 22.19.0 or later.
  • HTTP/2 Enabled by Default: HTTP/2 is now enabled by default. Applications that depend on HTTP/1.1-only behavior must explicitly set the allowH2: false option in their client or pool configuration.
  • Dispatcher API: The handler API for custom dispatchers and interceptors has been updated. Legacy callbacks like onConnect, onHeaders, and onComplete have been removed and must be migrated to the new API.
  • throwOnError Removed: The throwOnError option for undici.request() has been removed. This functionality should now be implemented using an interceptor.
  • Stricter Blob/File Handling: Undici v8 now requires real Blob and File instances and no longer accepts objects that only imitate their structure.

Recommendation:
Before upgrading, verify your Node.js runtime version is at least 22.19.0. Carefully review the official migration guide, especially if you use custom dispatchers, interceptors, or rely on HTTP/1.1-specific behavior. Code changes will likely be required to adapt to the new API and default settings.

Source: Migrating from Undici 7 to 8

Notice 🤖: This content was augmented using artificial intelligence. AI-generated content may contain errors and should be reviewed for accuracy before use.

@Aravind-Kumar-cstk
Aravind-Kumar-cstk requested a review from a team as a code owner July 26, 2026 03:17
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants