vulns.co
/
GKData.io MCP and API Buy me a coffee

zhero_web_security

Next.js: response metadata must preserve representation boundaries

Researchers report stored browser script execution in an anonymized production Next.js application with unusual middleware header copying and an external shared cache. Client-supplied metadata changed how the browser interpreted a dynamic App Router response, and the cache retained that mismatch for later visitors. The lesson is to keep response metadata consistent with the content it describes.

Open the referenceResearch PaperReviewed 2026-10-04

How to use this reference

Keep ownership of response interpretation with the component that creates the body. Next.js documentation warns that copying incoming headers into responses can override framework expectations and recommends selective forwarding. Editorial lesson: review body format, response metadata and cache variation as one contract. Data safe for one consumer may be unsafe for another; persistence does not repair that mismatch. An application review should distinguish intended upstream request metadata from browser-facing response metadata and document which layer owns each decision.

Before reading

  • HTTP request and response metadata, content negotiation and shared-cache concepts
  • Basic server-rendered framework and browser interpretation concepts

Context and limits

  • Exposure requires the described header-copying behavior, a dynamic representation and external caching. This is configuration-specific; the article does not establish a universal Next.js flaw.
  • The reported effect still requires a visitor to load affected content. The publication supplies no independently corroborated vendor incident account, verified fixed version or remediation date.
  • The unspecified five-figure award establishes neither an exact amount nor a currency. This resource does not qualify as an award-backed report.

Sources

  1. Re:CACHE: Next.js response-reflection researchzhero_web_security · reviewed 2026-10-04
  2. NextResponse documentation: request forwarding and response headersNext.js · reviewed 2026-10-04

Record reviewed 2026-10-04. Snapshot af2809c308fc. Open the complete JSON contract.

Library synced 2026-11-18 · cases last reviewed 2026-10-05

af2809c308fc · JSON exports & schemas · CC BY 4.0 content / MIT software