The vulnerability, identified as GHSA-wfc6-r584-vfw7, is a cache poisoning issue in Next.js applications using React Server Components (RSC). The root cause was an inconsistent interpretation of the RSC request header across different parts of the application and infrastructure (like CDNs or reverse proxies). An attacker could send a request with a malformed RSC header (e.g., RSC: 0 or RSC: true instead of the expected RSC: 1). Some parts of the Next.js server would interpret this loosely (e.g., using Boolean(header_value)) and treat it as a valid RSC request, while a cache might not, or vice-versa. This discrepancy allowed an attacker to poison the cache, causing subsequent users requesting a normal HTML page to receive a raw RSC data payload, breaking the page.
The fix, identified in commit 0dd94836a8b43209fcfefa448c141683c22c1a27, was to introduce a strict validation function, isRSCRequestHeader, which only accepts the literal string '1' as a valid indicator of an RSC request. This function was then applied consistently across all points where the RSC header is inspected, including the main request handler, route resolvers, and rendering logic. By enforcing a single, strict interpretation of the header, the patch eliminates the ambiguity that led to the cache poisoning vulnerability.