GHSA-h694-7cp9-m8p3: Npm/next vulnerability
Impact
With Cache Components enabled (cacheComponents: true), a 'use cache' function that calls another 'use cache' function that reads a root param can be keyed incorrectly when the inner call is served from an existing entry: the enclosing function's cache key then omits that root param. The enclosing entry is written once and reused for all root param values, so a response for one root param value can serve content produced for a different value — whether the page is prerendered at build time or at runtime, or rendered dynamically. Shared cache headers let downstream caches redistribute the content further.
What values are leaked cannot be attacker controlled. Which value's content is served depends only on which invocation wrote the entry first.
Workarounds
There are no known workarounds. Apps should upgrade to the patched version as soon as possible.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/nextto a version that resolves this vulnerability.Fixed in 16.3.8
Event History
Frequently Asked Questions
Which applications are exposed?
Applications using Next.js with Cache Components enabled through cacheComponents: true are exposed when a 'use cache' function calls another 'use cache' function that reads a root parameter.
What determines whether content from one root parameter is returned for another?
The content that is reused is determined by which invocation writes the enclosing cache entry first. This can occur for build-time prerendering, runtime prerendering, or dynamic rendering, and shared cache headers can allow downstream caches to redistribute the response.
Can an attacker choose the leaked value?
No. The leaked values cannot be attacker controlled; the issue is limited to content being served for the wrong root parameter value based on cache-entry ordering.
What should teams do if they cannot patch immediately?
There are no known workarounds. Applications should upgrade to a patched version as soon as possible.