[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"verticals":3,"quiz-nextjs-weekly-response-injection-forwarded-fetch":44,"search-suggestions":60,"quiz-article-nextjs-weekly-response-injection-forwarded-fetch":109,"path-membership-nextjs-weekly-response-injection-forwarded-fetch":475},[4,20,32],{"id":5,"slug":6,"name":7,"tagline":8,"description":9,"accentFrom":10,"accentTo":11,"icon":12,"defaultLocale":13,"locales":14,"features":16,"position":19},"019fe637-3d33-714b-b57f-23e163ffca0c","dev","Web Development","Read it. Run it. Prove it.","A post a day on modern web development — most with an editable playground and a quiz that explains every answer. Free, no account needed.","violet-500","cyan-400","◇","en",[13,15],"fa",{"courses":17,"paths":17,"articles":17,"exams":18,"flashcards":18,"packages":17,"community":17,"certificates":17,"teams":17,"commerce":17},true,false,0,{"id":21,"slug":22,"name":23,"tagline":24,"description":25,"accentFrom":26,"accentTo":10,"icon":27,"defaultLocale":13,"locales":28,"features":30,"position":31},"019fe637-3dc2-754c-8657-0f175bfee7c6","lang","Languages","Learn a language the way you learn a codebase.","Grammar explained the way good documentation explains an API — one idea at a time, each with a quiz.","amber-400","⌘",[13,15,29],"es",{"courses":18,"paths":18,"articles":17,"exams":18,"flashcards":17,"packages":18,"community":17,"certificates":17,"teams":18,"commerce":18},2,{"id":33,"slug":34,"name":35,"tagline":36,"description":37,"accentFrom":38,"accentTo":39,"icon":40,"defaultLocale":13,"locales":41,"features":42,"position":43},"7b3c16f2-931d-410e-802e-e1fa4edab7de","soft","Soft Skills","The half of the job nobody wrote documentation for.","Weekly, on the parts of working life that decide more than your code does — first weeks, meetings, interviews, promotions, and the people around you. Written from what actually happens, and recorded as a podcast you can listen to on the walk.","emerald-400","teal-300","◉",[13],{"courses":18,"paths":18,"articles":17,"exams":18,"flashcards":18,"packages":18,"community":17,"certificates":18,"teams":18,"commerce":18},3,{"id":45,"slug":46,"kind":47,"title":48,"description":49,"config":50,"verticalId":5,"vertical":55,"course":52,"_count":56,"access":57,"attempts":59,"questionCount":51},"01a21cc5-7941-759d-aafe-944f499afd1f","nextjs-weekly-response-injection-forwarded-fetch","PRACTICE_QUIZ","Next.js Response Injection (CVE-2026-119348)","Test yourself on GHSA-pc58-hwjq-p385: what makes forwarding a fetch() response unchanged risky, how HTTP\u002F1.1 framing and shared connections turn that into a cross-client leak, and the pattern that avoids it.",{"questionCount":51,"timeLimitSec":52,"shuffleQuestions":18,"shuffleOptions":17,"negativeMarking":19,"passScorePct":53,"maxAttempts":52,"revealAnswers":54,"allowFlagging":18,"allowBacktracking":17},8,null,70,"AFTER_SUBMIT",{"slug":6,"name":7},{"questions":51},{"allowed":17,"reason":58},"FREE",[],[61,65,69,73,77,81,85,89,93,97,101,105],{"slug":62,"name":63,"articles":64},"webdev","Webdev",197,{"slug":66,"name":67,"articles":68},"javascript","Javascript",157,{"slug":70,"name":71,"articles":72},"frontend","Frontend",103,{"slug":74,"name":75,"articles":76},"tutorial","Tutorial",87,{"slug":78,"name":79,"articles":80},"css","Css",56,{"slug":82,"name":83,"articles":84},"typescript","Typescript",37,{"slug":86,"name":87,"articles":88},"performance","Performance",33,{"slug":90,"name":91,"articles":92},"programming","Programming",26,{"slug":94,"name":95,"articles":96},"react","React",23,{"slug":98,"name":99,"articles":100},"node","Node",19,{"slug":102,"name":103,"articles":104},"browser","Browser",18,{"slug":106,"name":107,"articles":108},"nextjs","Nextjs",14,{"id":110,"slug":46,"title":111,"subtitle":52,"excerpt":112,"coverUrl":113,"locale":13,"readingMinutes":108,"publishedAt":114,"viewCount":115,"likeCount":19,"commentCount":19,"author":116,"vertical":121,"topic":122,"tags":123,"_count":130,"playground":132,"body":134,"bodyMd":403,"seo":404,"translationGroupId":406,"series":407,"podcastUrl":52,"verticalId":5,"thread":466,"assessments":468,"translations":471,"quiz":473},"01a21cc5-78fc-7169-bbde-dbfae80d051c","Next.js Response Injection: The Bug Behind CVE-2026-119348","Next.js 16.4.5 patched a response injection bug (CVE-2026-119348): forwarding fetch() verbatim could desync clients. Includes a copy-paste cheat sheet.","\u002Fmedia\u002Fcovers\u002Fnextjs-weekly-response-injection-forwarded-fetch.png","2026-12-01T04:20:45.453Z",12,{"id":117,"name":118,"username":119,"avatarUrl":52,"headline":120},"019fe637-3c25-7088-9034-39c9f15dc3c8","Parsa Jiravand","parsa","Frontend engineer · building bestpractic",{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":106,"name":107},[124,125,128,129],{"slug":106,"name":107,"color":52},{"slug":126,"name":127,"color":52},"security","Security",{"slug":74,"name":75,"color":52},{"slug":62,"name":63,"color":52},{"assessments":131},1,{"slug":46,"title":133},"Next.js response injection (CVE-2026-119348) — playground",{"blocks":135,"version":131},[136,140,143,148,151,160,163,166,177,180,183,189,192,195,198,201,204,207,210,214,217,221,224,227,230,233,236,239,246,249,257,260,264,267,270,273,277,280,283,286,289,292,295,298,301,304,307,310,342,345,348,351,354,357,360,367,370,373,376,379,385,388,391,394,397],{"id":137,"html":138,"type":139},"b1","\u003Cp>On November 3, 2026, the Next.js team shipped 16.4.5 as a security release. Buried among seven fixes is \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js\u002Fsecurity\u002Fadvisories\u002FGHSA-pc58-hwjq-p385\">GHSA-pc58-hwjq-p385\u003C\u002Fa> (CVE-2026-119348): a self-hosted App Router app that forwards a fetched upstream response unchanged — through a Route Handler, or through the fetch cache replaying one — can leak framing headers that don&#39;t match the body it actually sends. Sit that app behind an HTTP\u002F1.1 reverse proxy that queues pipelined responses on a shared backend connection, and a crafted upstream response can desynchronize two clients&#39; responses: one tenant&#39;s browser ends up holding bytes meant for someone else&#39;s request.\u003C\u002Fp>","paragraph",{"id":141,"html":142,"type":139},"b2","\u003Cp>This is written against \u003Cstrong>Next.js 16.4.5\u003C\u002Fstrong> (verified against the framework&#39;s own GitHub security advisory, published November 3, 2026; affected versions are 16.0.0 through 16.4.4 and 15.5.28 and below). If you&#39;re not pinned to an old version, \u003Ccode>npm install next@latest\u003C\u002Fcode> already closes it — the advisory rates it Moderate (CVSS v4 6.3) and names no working exploit in the wild. What&#39;s worth your time is \u003Cem>why\u003C\u002Fem> this class of bug exists at all, because the mechanism has nothing to do with a Next.js mistake in the usual sense. It&#39;s the oldest trick in HTTP — response splitting — and Next.js earns a chapter in that story only because \u003Ccode>fetch()\u003C\u002Fcode> makes &quot;just return the upstream response&quot; one line of code, which is exactly how this family of bugs always gets in.\u003C\u002Fp>",{"id":144,"html":145,"text":146,"type":147,"level":31},"b3","What you&#39;ll learn","What you'll learn","heading",{"id":149,"html":150,"type":139},"b4","\u003Cp>By the end of this article you&#39;ll be able to:\u003C\u002Fp>",{"id":152,"type":153,"items":154,"ordered":18},"b5","list",[155,156,157,158,159],"Explain what an HTTP\u002F1.1 connection&#39;s &quot;framing&quot; is, and why \u003Ccode>Content-Length\u003C\u002Fcode> and \u003Ccode>Transfer-Encoding\u003C\u002Fcode> are promises a server makes to whoever reuses that connection next","Explain exactly what CVE-2026-119348 is (and isn&#39;t): what &quot;forwarding a response unchanged&quot; means in an App Router Route Handler and in the fetch cache","Reproduce, conceptually, how a reverse proxy pipelining requests over one shared backend connection can hand one client&#39;s browser a different client&#39;s response","Audit your own Route Handlers for the pattern that makes this bug possible, independent of whether you&#39;re already patched","Write a Route Handler that proxies an upstream response safely, by habit, not by luck",{"id":161,"html":162,"type":139},"b6","\u003Cp>\u003Cstrong>Who this is for:\u003C\u002Fstrong> you&#39;re building App Router Route Handlers that call out to another API and return its response — a BFF layer, an image proxy, a webhook relay, anything that sits in front of someone else&#39;s service. If Route Handler caching itself is new to you, this series&#39; \u003Ca href=\"https:\u002F\u002Fdev.to\u002Fparsajiravand\u002Fnextjs-route-handlers-get-stopped-caching-in-15-how-to-cache-in-16-56nb\">Route Handlers get stopped caching\u003C\u002Fa> covers the basics first — worth reading before this one, not required. If you run Next.js behind your own reverse proxy rather than a managed platform, the network-boundary model in \u003Ca href=\"https:\u002F\u002Fdev.to\u002Fparsajiravand\u002Fnextjs-proxyts-explained-with-cheat-sheet-j4i\">Next.js proxy.ts Explained\u003C\u002Fa> is useful background too.\u003C\u002Fp>",{"id":164,"html":165,"text":165,"type":147,"level":31},"b7","Contents",{"id":167,"type":153,"items":168,"ordered":18},"b8",[169,170,171,172,173,174,175,176],"\u003Ca href=\"#the-bug-shown-wrong-way-first\">The bug, shown wrong-way-first\u003C\u002Fa>","\u003Ca href=\"#the-mental-model-a-connection-is-a-shared-pipe-and-framing-is-the-only-fence\">The mental model: a connection is a shared pipe, and framing is the only fence\u003C\u002Fa>","\u003Ca href=\"#staged-walkthrough-from-one-fetch-call-to-a-cross-client-leak\">Staged walkthrough: from one \u003Ccode>fetch()\u003C\u002Fcode> call to a cross-client leak\u003C\u002Fa>","\u003Ca href=\"#edge-cases\">Edge cases\u003C\u002Fa>","\u003Ca href=\"#best-practices\">Best practices\u003C\u002Fa>","\u003Ca href=\"#faq\">FAQ\u003C\u002Fa>","\u003Ca href=\"#cheat-sheet\">Cheat sheet\u003C\u002Fa>","\u003Ca href=\"#key-takeaways\">Key takeaways\u003C\u002Fa>",{"id":178,"html":179,"text":179,"type":147,"level":31},"b9","The bug, shown wrong-way-first",{"id":181,"html":182,"type":139},"b10","\u003Cp>Say you&#39;re building a Route Handler that fronts an internal pricing API, so the browser only ever talks to your own domain:\u003C\u002Fp>",{"id":184,"code":185,"type":186,"language":187,"highlight":188},"b11","\u002F\u002F app\u002Fapi\u002Fprice\u002F[sku]\u002Froute.ts — the \"just forward it\" version\nexport async function GET(\n  req: Request,\n  { params }: { params: Promise\u003C{ sku: string }> }\n) {\n  const { sku } = await params\n  const upstream = await fetch(`https:\u002F\u002Fpricing.internal\u002Fv1\u002Fprice\u002F${sku}`)\n  return upstream \u002F\u002F hand the Response straight back to the browser\n}","code","ts",[],{"id":190,"html":191,"type":139},"b12","\u003Cp>This looks completely reasonable, and for a single isolated request it behaves correctly: the status, body, and headers from \u003Ccode>pricing.internal\u003C\u002Fcode> reach the browser untouched. The App Router happily accepts a \u003Ccode>Response\u003C\u002Fcode> object returned from a Route Handler — that&#39;s the documented, idiomatic way to return a response at all.\u003C\u002Fp>",{"id":193,"html":194,"type":139},"b13","\u003Cp>The gap is what &quot;untouched&quot; includes. The upstream response&#39;s framing headers — the ones that tell whatever is holding the TCP connection where this response&#39;s body ends and the next one begins (\u003Ccode>Content-Length\u003C\u002Fcode>, \u003Ccode>Transfer-Encoding: chunked\u003C\u002Fcode>, \u003Ccode>Connection\u003C\u002Fcode>) — are forwarded along with everything else. Your Route Handler never built its own framing; it&#39;s reusing whatever \u003Ccode>pricing.internal\u003C\u002Fcode> sent, and trusting it to accurately describe the bytes that follow.\u003C\u002Fp>",{"id":196,"html":197,"type":139},"b14","\u003Cp>Deploy this behind an HTTP\u002F1.1 reverse proxy that pipelines requests — queues several clients&#39; requests onto one shared keep-alive connection to your Next.js server to save on connection overhead — and that trust becomes the whole bug. \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js\u002Fsecurity\u002Fadvisories\u002FGHSA-pc58-hwjq-p385\">GHSA-pc58-hwjq-p385\u003C\u002Fa> describes exactly this shape: &quot;a crafted upstream response can desynchronize responses between clients,&quot; letting one client&#39;s request receive &quot;response injection and disclosure of other clients&#39; responses.&quot; The official advisory stops there deliberately — it names the mechanism (framing headers that don&#39;t match the body sent) and the precondition (a pipelining HTTP\u002F1.1 reverse proxy on a shared backend connection) without publishing a working repro, which is normal disclosure practice for a bug in this class. What it hands you instead is enough to understand \u003Cem>why\u003C\u002Fem> the pattern above is dangerous, which is the useful part anyway: the fix is one \u003Ccode>npm install\u003C\u002Fcode>, but the pattern that caused it is something you&#39;re probably still writing today, patched or not.\u003C\u002Fp>",{"id":199,"html":200,"text":200,"type":147,"level":31},"b15","The mental model: a connection is a shared pipe, and framing is the only fence",{"id":202,"html":203,"type":139},"b16","\u003Cp>\u003Cstrong>The mental model:\u003C\u002Fstrong> an HTTP\u002F1.1 keep-alive connection is a single ordered byte stream carrying multiple request\u002Fresponse pairs back to back, with no built-in boundary markers between them. The only thing separating &quot;response A ends here&quot; from &quot;response B starts here&quot; is a promise the server makes in its own headers — \u003Ccode>Content-Length: N\u003C\u002Fcode> (&quot;read exactly N bytes and stop&quot;) or \u003Ccode>Transfer-Encoding: chunked\u003C\u002Fcode> (a series of self-describing length-prefixed chunks ending in a zero-length chunk). Whoever is reading that stream — a browser, or a reverse proxy multiplexing several clients onto one backend connection — has to take that promise at face value, because the wire gives it nothing else to go on.\u003C\u002Fp>",{"id":205,"html":206,"type":139},"b17","\u003Cp>That promise is also the whole attack surface of the \u003Cstrong>response-splitting \u002F response-desync\u003C\u002Fstrong> bug family (tracked more generally as \u003Ca href=\"https:\u002F\u002Fcwe.mitre.org\u002Fdata\u002Fdefinitions\u002F444.html\">CWE-444, &quot;Inconsistent Interpretation of HTTP Requests&quot;\u003C\u002Fa>): if the declared framing disagrees with the bytes actually sent — say the header claims a \u003Ccode>Content-Length\u003C\u002Fcode> shorter than the real body — the reader stops reading where the header says to, and treats the leftover bytes as the start of the \u003Cem>next\u003C\u002Fem> response on the connection. On a connection serving one client, that&#39;s merely a parsing bug. On a \u003Cstrong>shared, pipelined\u003C\u002Fstrong> connection serving several clients&#39; queued requests, those leftover bytes are the beginning of someone else&#39;s conversation — which is precisely the &quot;cross-client&quot; half of this advisory&#39;s name.\u003C\u002Fp>",{"id":208,"html":209,"type":139},"b18","\u003Cp>Next.js doesn&#39;t invent this bug class; it just hands you, via \u003Ccode>fetch()\u003C\u002Fcode>, an unusually easy way to opt into trusting an upstream&#39;s framing instead of generating your own. Every reverse proxy and every API gateway has to solve this same problem, and the standard answer is the same everywhere: \u003Cstrong>never let an upstream&#39;s framing headers reach the client verbatim.\u003C\u002Fstrong> Regenerate the response you send, and let your own runtime compute its own framing from the body you actually serve.\u003C\u002Fp>",{"id":211,"html":212,"text":213,"type":147,"level":31},"b19","Staged walkthrough: from one \u003Ccode>fetch()\u003C\u002Fcode> call to a cross-client leak","Staged walkthrough: from one fetch() call to a cross-client leak",{"id":215,"html":216,"type":139},"b20","\u003Cp>\u003Cstrong>Stage 1 — the single-request view (looks fine).\u003C\u002Fstrong> One client, one request, one response. \u003Ccode>fetch()\u003C\u002Fcode> returns a \u003Ccode>Response\u003C\u002Fcode>, your handler returns it, the browser renders it. Nothing here reveals the bug, because a single unshared connection has no second response to collide with.\u003C\u002Fp>",{"id":218,"code":219,"type":186,"language":187,"highlight":220},"b21","const upstream = await fetch(url)\nreturn upstream",[],{"id":222,"html":223,"type":139},"b22","\u003Cp>\u003Cstrong>Key concept:\u003C\u002Fstrong> a \u003Ccode>Response\u003C\u002Fcode> object carries its headers as a live \u003Ccode>Headers\u003C\u002Fcode> instance, and returning it verbatim means every header the upstream sent — including the ones that only make sense on \u003Cem>that\u003C\u002Fem> connection, between \u003Cem>that\u003C\u002Fem> pair of servers — rides along to the browser.\u003C\u002Fp>",{"id":225,"html":226,"type":139},"b23","\u003Cp>\u003Cstrong>Stage 2 — add a shared, pipelined connection.\u003C\u002Fstrong> This is the precondition the advisory names explicitly, not a hypothetical: &quot;an app sits behind an HTTP\u002F1.1 reverse proxy that permits pipelined response queueing&quot; on a connection to the backend shared across clients. Picture two requests, from two different browsers, queued through the proxy onto the same keep-alive connection to your Next.js server: request A, then request B, back to back, same socket.\u003C\u002Fp>",{"id":228,"html":229,"type":139},"b24","\u003Cp>\u003Cstrong>Stage 3 — the upstream response disagrees with its own framing.\u003C\u002Fstrong> Your Route Handler&#39;s \u003Ccode>fetch()\u003C\u002Fcode> call to the internal API gets back a response whose declared length doesn&#39;t match its real body — crafted, buggy, or simply mis-proxied upstream of \u003Cem>you\u003C\u002Fem>. You forward it unchanged. The reverse proxy, reading strictly by the framing header it was told to trust, stops reading response A&#39;s body exactly where that header says to — which is \u003Cem>before\u003C\u002Fem> the real end of the bytes Next.js actually wrote to the socket.\u003C\u002Fp>",{"id":231,"html":232,"type":139},"b25","\u003Cp>\u003Cstrong>Stage 4 — the leftover bytes become someone else&#39;s response.\u003C\u002Fstrong> Whatever Next.js wrote after the point the proxy thought response A ended is still sitting on the connection. The proxy, having already moved on to deliver request B&#39;s turn, reads those leftover bytes as the start of \u003Cem>response B\u003C\u002Fem> — and hands client B a response built partly or wholly from client A&#39;s data. This is the &quot;disclosure of other clients&#39; responses&quot; the advisory describes, and depending on exactly how the bytes land, it can go the other way too: a crafted response can \u003Cem>inject\u003C\u002Fem> content into a connection it was never meant to answer.\u003C\u002Fp>",{"id":234,"html":235,"type":139},"b26","\u003Cp>\u003Cstrong>Key concept:\u003C\u002Fstrong> nothing about steps 3–4 requires a bug in Next.js&#39;s own rendering, routing, or caching logic. The entire mechanism lives in the gap between &quot;what the framing header claims&quot; and &quot;what bytes were actually written&quot; — a gap that only opens because step 1 forwarded an upstream&#39;s framing headers instead of generating fresh ones.\u003C\u002Fp>",{"id":237,"html":238,"text":238,"type":147,"level":31},"b27","Edge cases",{"id":240,"type":153,"items":241,"ordered":18},"b28",[242,243,244,245],"\u003Cstrong>The fetch cache, not just Route Handlers.\u003C\u002Fstrong> The advisory&#39;s title names both &quot;App Router route handlers&quot; and &quot;the fetch cache&quot; as paths to this bug. A cached \u003Ccode>fetch()\u003C\u002Fcode> result that gets replayed later carries the same risk if what&#39;s replayed includes the original framing headers rather than a freshly computed response — the vulnerable pattern is &quot;store and replay an upstream response&#39;s own header set,&quot; wherever in your app that happens.","\u003Cstrong>Not every reverse proxy is affected.\u003C\u002Fstrong> The advisory is specific: the precondition is an HTTP\u002F1.1 proxy that does pipelined response queueing on a shared backend connection. A proxy that opens one backend connection per client request, or that terminates HTTP\u002F1.1 and speaks HTTP\u002F2 or HTTP\u002F3 to clients while multiplexing properly on the backend, doesn&#39;t have the &quot;leftover bytes land in someone else&#39;s turn&quot; step that makes this dangerous. If you don&#39;t know which your platform does, treat yourself as in scope and patch anyway — the fix costs nothing and the alternative is finding out the hard way.","\u003Cstrong>Managed hosting isn&#39;t automatically exempt.\u003C\u002Fstrong> The advisory&#39;s own framing is &quot;self-hosted,&quot; and some platforms have stated their specific proxy architecture isn&#39;t affected. That is a statement about one piece of infrastructure, not a blanket guarantee for every hosting target — verify your own platform&#39;s advisory, don&#39;t assume.","\u003Cstrong>This is a Moderate-severity, high-complexity bug, not a trivial one.\u003C\u002Fstrong> The CVSS v4 vector lists \u003Ccode>AC:H\u003C\u002Fcode> (high attack complexity) and \u003Ccode>AT:P\u003C\u002Fcode> (attack requirements present) — exploitation needs the specific proxy behavior lined up, not just an internet connection. That earns &quot;patch promptly,&quot; not &quot;panic.&quot;",{"id":247,"html":248,"text":248,"type":147,"level":31},"b29","Best practices",{"id":250,"type":153,"items":251,"ordered":18},"b30",[252,253,254,255,256],"\u003Cstrong>Never return a fetched \u003Ccode>Response\u003C\u002Fcode> to the client unchanged.\u003C\u002Fstrong> Build your own: read what you need from the upstream (\u003Ccode>.json()\u003C\u002Fcode>, \u003Ccode>.text()\u003C\u002Fcode>, or stream the body if you must), and construct a fresh \u003Ccode>Response\u003C\u002Fcode> with exactly the headers your own API contract requires. Let the runtime compute \u003Ccode>Content-Length\u003C\u002Fcode> or chunk the body itself — don&#39;t copy the upstream&#39;s framing headers into yours.\n\u003Ccode>ts const upstream = await fetch(url) const data = await upstream.json() return Response.json(data, {   status: upstream.status,   headers: { &quot;cache-control&quot;: &quot;no-store&quot; }, \u002F\u002F only headers you intend to set }) \u003C\u002Fcode>","\u003Cstrong>If you must stream a large body through, still don&#39;t trust the upstream&#39;s own framing.\u003C\u002Fstrong> Stream \u003Ccode>upstream.body\u003C\u002Fcode> into a response you construct, with headers you set explicitly — not \u003Ccode>new Response(upstream.body, { headers: upstream.headers })\u003C\u002Fcode>, which carries the same risk the advisory describes.","\u003Cstrong>Treat hop-by-hop headers as never-forward, always.\u003C\u002Fstrong> \u003Ccode>Connection\u003C\u002Fcode>, \u003Ccode>Transfer-Encoding\u003C\u002Fcode>, \u003Ccode>Content-Length\u003C\u002Fcode>, \u003Ccode>Keep-Alive\u003C\u002Fcode>: these describe the upstream&#39;s own connection to \u003Cem>its\u003C\u002Fem> caller, not yours to the browser. If you need to pass through headers wholesale for a legitimate proxy use case, allow-list the ones you actually need instead of spreading everything.","\u003Cstrong>Know whether your reverse proxy pipelines on a shared backend connection.\u003C\u002Fstrong> This is an infrastructure question, not a Next.js one — ask your platform or your ops team, and if you don&#39;t get a clear answer, patch and move on regardless.","\u003Cstrong>Patch on a schedule, not on a hunch.\u003C\u002Fstrong> A Moderate, high-complexity CVE like this one is exactly what dependency update automation (Dependabot, Renovate) exists for. Don&#39;t wait for a deep-dive to tell you to run \u003Ccode>npm install next@latest\u003C\u002Fcode> — this article is about the mechanism, not a substitute for routine patching.",{"id":258,"html":259,"text":259,"type":147,"level":31},"b31","FAQ",{"id":261,"html":262,"text":263,"type":147,"level":43},"b32","Is my app vulnerable if I don&#39;t run any Route Handlers?","Is my app vulnerable if I don't run any Route Handlers?",{"id":265,"html":266,"type":139},"b33","\u003Cp>Possibly still yes, per the advisory&#39;s own wording: the fetch cache replaying a previously fetched upstream response is named as a second path to the same bug, independent of whether you write Route Handlers yourself. Patching to 16.4.5 (or 15.5.29) closes both paths; the defensive pattern in this article (never forward upstream framing headers) is the thing to also apply by hand anywhere your own code constructs a response from an upstream fetch.\u003C\u002Fp>",{"id":268,"html":269,"text":269,"type":147,"level":43},"b34","Does this affect the Pages Router too?",{"id":271,"html":272,"type":139},"b35","\u003Cp>The advisory&#39;s affected-versions list includes 15.5.28 and below, which predates the App Router being the default, so Pages Router apps that proxy upstream responses through an API route are not automatically exempt from the underlying pattern — the same &quot;don&#39;t forward upstream framing headers&quot; rule applies there. Check your specific setup against the advisory rather than assuming either router is safe by default.\u003C\u002Fp>",{"id":274,"html":275,"text":276,"type":147,"level":43},"b36","Is this the same bug as the \u003Ccode>unstable_cache\u003C\u002Fcode> cross-tenant leak from the same release?","Is this the same bug as the unstablecache cross-tenant leak from the same release?",{"id":278,"html":279,"type":139},"b37","\u003Cp>No — they&#39;re two separate advisories in the same November 3, 2026 security release. \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js\u002Fsecurity\u002Fadvisories\u002FGHSA-mfr8-8qww-v76h\">GHSA-mfr8-8qww-v76h\u003C\u002Fa> (covered in this series&#39; \u003Ca href=\"https:\u002F\u002Fdev.to\u002Fparsajiravand\u002Fnextjs-1645-how-unstablecache-leaked-data-across-root-params-1om0\">unstable_cache root-param leak\u003C\u002Fa> episode) is a cache-key bug: a \u003Ccode>&quot;use cache&quot;\u003C\u002Fcode> function&#39;s key didn&#39;t account for a root param it read. This one, GHSA-pc58-hwjq-p385, is a connection-level HTTP framing bug with nothing to do with cache keys. Both are fixed by the same 16.4.5 upgrade.\u003C\u002Fp>",{"id":281,"html":282,"text":282,"type":147,"level":43},"b38","Do I need a specific reverse proxy to be at risk?",{"id":284,"html":285,"type":139},"b39","\u003Cp>The advisory names the precondition precisely: an HTTP\u002F1.1 reverse proxy that performs pipelined response queueing over a connection shared by multiple clients to your backend. If you don&#39;t control or can&#39;t confirm your proxy&#39;s behavior, the safe assumption is &quot;maybe,&quot; and the fix — upgrading, plus never forwarding upstream framing headers by habit — costs nothing to apply regardless of the answer.\u003C\u002Fp>",{"id":287,"html":288,"text":288,"type":147,"level":43},"b40","Was this exploited before it was patched?",{"id":290,"html":291,"type":139},"b41","\u003Cp>The GitHub security advisory for GHSA-pc58-hwjq-p385 does not claim or document any known exploitation; it describes the vulnerability class, the precondition, and the fixed versions. Treat the absence of a reported incident as exactly that — an absence of a reported incident, not a guarantee.\u003C\u002Fp>",{"id":293,"html":294,"type":139},"b42","\u003C!-- playground:start -->",{"id":296,"html":297,"text":297,"type":147,"level":31},"b43","🎮 Try it yourself",{"id":299,"html":300,"type":139},"b44","\u003Cp>\u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-response-injection-forwarded-fetch\u002Fplayground\">▶️ Open the interactive playground →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":302,"html":303,"type":139},"b45","\u003Cp>\u003Cem>Runs right in your browser — poke at it and watch the concept react live.\u003C\u002Fem>\u003C\u002Fp>",{"id":305,"html":306,"type":139},"b46","\u003C!-- playground:end -->",{"id":308,"html":309,"text":309,"type":147,"level":31},"b47","Cheat sheet",{"id":311,"head":312,"rows":316,"type":341},"b48",[313,314,315],"Situation","Do this","Why",[317,321,325,329,333,337],[318,319,320],"Route Handler calls \u003Ccode>fetch()\u003C\u002Fcode> and wants to send the result to the browser","\u003Ccode>const data = await upstream.json(); return Response.json(data, { status: upstream.status })\u003C\u002Fcode>","You build fresh framing headers; nothing from upstream&#39;s \u003Ccode>Content-Length\u003C\u002Fcode>\u002F\u003Ccode>Transfer-Encoding\u003C\u002Fcode> survives",[322,323,324],"You must stream a large upstream body through","\u003Ccode>return new Response(upstream.body, { status: upstream.status, headers: pickedHeaders })\u003C\u002Fcode> with \u003Ccode>pickedHeaders\u003C\u002Fcode> an explicit allow-list you built yourself","Streaming is fine; forwarding the upstream \u003Ccode>Headers\u003C\u002Fcode> object wholesale is the risky part",[326,327,328],"Replaying a previously fetched response from your own cache","Store the data, not the raw \u003Ccode>Response\u003C\u002Fcode>\u002F\u003Ccode>Headers\u003C\u002Fcode>; reconstruct the response at serve time","A stored response can carry the same stale\u002Fmismatched framing the advisory describes",[330,331,332],"Checking if you&#39;re affected","\u003Ccode>npm view next version\u003C\u002Fcode> — anything 16.0.0–16.4.4 or ≤15.5.28 is affected","Advisory GHSA-pc58-hwjq-p385, CVE-2026-119348",[334,335,336],"Fixing it","\u003Ccode>npm install next@latest\u003C\u002Fcode> (or pin ≥16.4.5 \u002F ≥15.5.29)","Confirmed-patched versions per the official advisory",[338,339,340],"Headers that should never be copied from an upstream response","\u003Ccode>Content-Length\u003C\u002Fcode>, \u003Ccode>Transfer-Encoding\u003C\u002Fcode>, \u003Ccode>Connection\u003C\u002Fcode>, \u003Ccode>Keep-Alive\u003C\u002Fcode>","These describe the upstream&#39;s connection to \u003Cem>its\u003C\u002Fem> caller, not yours to the browser","table",{"id":343,"html":344,"type":139},"b49","\u003C!-- quiz:start -->",{"id":346,"html":347,"text":347,"type":147,"level":31},"b50","🧠 Test yourself",{"id":349,"html":350,"type":139},"b51","\u003Cp>Think it clicked? \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-response-injection-forwarded-fetch\u002Fquiz\">Take the 8-question quiz →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":352,"html":353,"type":139},"b52","\u003Cp>\u003Cem>Instant feedback, a hint on every question, and an explanation for each answer — right or wrong.\u003C\u002Fem>\u003C\u002Fp>",{"id":355,"html":356,"type":139},"b53","\u003C!-- quiz:end -->",{"id":358,"html":359,"text":359,"type":147,"level":31},"b54","Key takeaways",{"id":361,"type":153,"items":362,"ordered":18},"b55",[363,364,365,366],"\u003Cstrong>An HTTP\u002F1.1 connection has no built-in message boundaries\u003C\u002Fstrong> — only the framing headers a server declares (\u003Ccode>Content-Length\u003C\u002Fcode>, \u003Ccode>Transfer-Encoding\u003C\u002Fcode>). A shared, pipelined connection makes a framing mismatch a cross-client problem, not just a parsing one.","\u003Cstrong>CVE-2026-119348 isn&#39;t a Next.js logic bug — it&#39;s response splitting, reached via \u003Ccode>fetch()\u003C\u002Fcode>.\u003C\u002Fstrong> Any Route Handler or cached-fetch replay that forwards an upstream \u003Ccode>Response\u003C\u002Fcode> unchanged carries its framing headers along for the ride.","\u003Cstrong>The fix that matters beyond the patch:\u003C\u002Fstrong> never forward an upstream response&#39;s framing headers to the client. Build your own \u003Ccode>Response\u003C\u002Fcode>, from data you&#39;ve read, with headers you chose — every time you proxy.","\u003Cstrong>Upgrade to 16.4.5 \u002F 15.5.29\u003C\u002Fstrong>, and audit any Route Handler or cache-replay code that does \u003Ccode>return upstreamResponse\u003C\u002Fcode> or spreads \u003Ccode>upstream.headers\u003C\u002Fcode> wholesale.",{"id":368,"html":369,"type":139},"b56","\u003Cp>You patched this one with an \u003Ccode>npm install\u003C\u002Fcode>. The pattern that made it possible — trusting someone else&#39;s framing because \u003Ccode>fetch()\u003C\u002Fcode> made it one line to forward — is still sitting in a lot of codebases that have never heard of this CVE and never will, until their own proxy starts pipelining. Go check your Route Handlers.\u003C\u002Fp>",{"id":371,"html":372,"type":139},"b57","\u003Cp>What&#39;s the first \u003Ccode>return upstream\u003C\u002Fcode> in your own code that you&#39;re now going to rewrite?\u003C\u002Fp>",{"id":374,"html":375,"type":139},"b58","\u003C!-- related:start -->",{"id":377,"html":378,"text":378,"type":147,"level":31},"b59","📚 Read next",{"id":380,"type":153,"items":381,"ordered":18},"b60",[382,383,384],"\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-unstable-cache-root-params-leak\">Next.js 16.4.5: How unstable_cache Leaked Data Across Root Params\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-middleware-to-proxy-network-boundary\">Next.js proxy.ts Explained (with Cheat Sheet)\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-route-handlers-caching-streaming\">Next.js Route Handlers: GET Stopped Caching in 15 — How to Cache in 16\u003C\u002Fa>",{"id":386,"html":387,"type":139},"b61","\u003C!-- related:end -->",{"id":389,"type":390},"b62","divider",{"id":392,"html":393,"type":139},"b63","\u003Cp>🚀 \u003Cstrong>Want more like this?\u003C\u002Fstrong> Every guide, playground, and quiz lives on \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">bestpractic.org\u003C\u002Fa>\u003C\u002Fstrong> — open it and \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">sign up free\u003C\u002Fa>\u003C\u002Fstrong> so the next one finds you.\u003C\u002Fp>",{"id":395,"html":396,"type":139},"b64","\u003Cp>\u003Cem>Thanks for reading! Let&#39;s stay connected:\u003C\u002Fem>\u003C\u002Fp>",{"id":398,"type":153,"items":399,"ordered":18},"b65",[400,401,402],"⭐ \u003Cstrong>GitHub\u003C\u002Fstrong> — follow me and star the projects: \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fparsajiravand\">github.com\u002Fparsajiravand\u003C\u002Fa>","💬 \u003Cstrong>Discord\u003C\u002Fstrong> — join the frontend best-practices community: \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ\">discord.gg\u002Fd9KRhuAwQ\u003C\u002Fa>","📸 \u003Cstrong>Instagram\u003C\u002Fstrong> — frontend best practices, daily: \u003Ca href=\"https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F\">@bestpractice___\u003C\u002Fa>","On November 3, 2026, the Next.js team shipped 16.4.5 as a security release. Buried among seven fixes is [GHSA-pc58-hwjq-p385](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js\u002Fsecurity\u002Fadvisories\u002FGHSA-pc58-hwjq-p385) (CVE-2026-119348): a self-hosted App Router app that forwards a fetched upstream response unchanged — through a Route Handler, or through the fetch cache replaying one — can leak framing headers that don't match the body it actually sends. Sit that app behind an HTTP\u002F1.1 reverse proxy that queues pipelined responses on a shared backend connection, and a crafted upstream response can desynchronize two clients' responses: one tenant's browser ends up holding bytes meant for someone else's request.\n\nThis is written against **Next.js 16.4.5** (verified against the framework's own GitHub security advisory, published November 3, 2026; affected versions are 16.0.0 through 16.4.4 and 15.5.28 and below). If you're not pinned to an old version, `npm install next@latest` already closes it — the advisory rates it Moderate (CVSS v4 6.3) and names no working exploit in the wild. What's worth your time is *why* this class of bug exists at all, because the mechanism has nothing to do with a Next.js mistake in the usual sense. It's the oldest trick in HTTP — response splitting — and Next.js earns a chapter in that story only because `fetch()` makes \"just return the upstream response\" one line of code, which is exactly how this family of bugs always gets in.\n\n## What you'll learn\n\nBy the end of this article you'll be able to:\n\n- Explain what an HTTP\u002F1.1 connection's \"framing\" is, and why `Content-Length` and `Transfer-Encoding` are promises a server makes to whoever reuses that connection next\n- Explain exactly what CVE-2026-119348 is (and isn't): what \"forwarding a response unchanged\" means in an App Router Route Handler and in the fetch cache\n- Reproduce, conceptually, how a reverse proxy pipelining requests over one shared backend connection can hand one client's browser a different client's response\n- Audit your own Route Handlers for the pattern that makes this bug possible, independent of whether you're already patched\n- Write a Route Handler that proxies an upstream response safely, by habit, not by luck\n\n**Who this is for:** you're building App Router Route Handlers that call out to another API and return its response — a BFF layer, an image proxy, a webhook relay, anything that sits in front of someone else's service. If Route Handler caching itself is new to you, this series' [Route Handlers get stopped caching](https:\u002F\u002Fdev.to\u002Fparsajiravand\u002Fnextjs-route-handlers-get-stopped-caching-in-15-how-to-cache-in-16-56nb) covers the basics first — worth reading before this one, not required. If you run Next.js behind your own reverse proxy rather than a managed platform, the network-boundary model in [Next.js proxy.ts Explained](https:\u002F\u002Fdev.to\u002Fparsajiravand\u002Fnextjs-proxyts-explained-with-cheat-sheet-j4i) is useful background too.\n\n## Contents\n\n- [The bug, shown wrong-way-first](#the-bug-shown-wrong-way-first)\n- [The mental model: a connection is a shared pipe, and framing is the only fence](#the-mental-model-a-connection-is-a-shared-pipe-and-framing-is-the-only-fence)\n- [Staged walkthrough: from one `fetch()` call to a cross-client leak](#staged-walkthrough-from-one-fetch-call-to-a-cross-client-leak)\n- [Edge cases](#edge-cases)\n- [Best practices](#best-practices)\n- [FAQ](#faq)\n- [Cheat sheet](#cheat-sheet)\n- [Key takeaways](#key-takeaways)\n\n## The bug, shown wrong-way-first\n\nSay you're building a Route Handler that fronts an internal pricing API, so the browser only ever talks to your own domain:\n\n```ts\n\u002F\u002F app\u002Fapi\u002Fprice\u002F[sku]\u002Froute.ts — the \"just forward it\" version\nexport async function GET(\n  req: Request,\n  { params }: { params: Promise\u003C{ sku: string }> }\n) {\n  const { sku } = await params\n  const upstream = await fetch(`https:\u002F\u002Fpricing.internal\u002Fv1\u002Fprice\u002F${sku}`)\n  return upstream \u002F\u002F hand the Response straight back to the browser\n}\n```\n\nThis looks completely reasonable, and for a single isolated request it behaves correctly: the status, body, and headers from `pricing.internal` reach the browser untouched. The App Router happily accepts a `Response` object returned from a Route Handler — that's the documented, idiomatic way to return a response at all.\n\nThe gap is what \"untouched\" includes. The upstream response's framing headers — the ones that tell whatever is holding the TCP connection where this response's body ends and the next one begins (`Content-Length`, `Transfer-Encoding: chunked`, `Connection`) — are forwarded along with everything else. Your Route Handler never built its own framing; it's reusing whatever `pricing.internal` sent, and trusting it to accurately describe the bytes that follow.\n\nDeploy this behind an HTTP\u002F1.1 reverse proxy that pipelines requests — queues several clients' requests onto one shared keep-alive connection to your Next.js server to save on connection overhead — and that trust becomes the whole bug. [GHSA-pc58-hwjq-p385](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js\u002Fsecurity\u002Fadvisories\u002FGHSA-pc58-hwjq-p385) describes exactly this shape: \"a crafted upstream response can desynchronize responses between clients,\" letting one client's request receive \"response injection and disclosure of other clients' responses.\" The official advisory stops there deliberately — it names the mechanism (framing headers that don't match the body sent) and the precondition (a pipelining HTTP\u002F1.1 reverse proxy on a shared backend connection) without publishing a working repro, which is normal disclosure practice for a bug in this class. What it hands you instead is enough to understand *why* the pattern above is dangerous, which is the useful part anyway: the fix is one `npm install`, but the pattern that caused it is something you're probably still writing today, patched or not.\n\n## The mental model: a connection is a shared pipe, and framing is the only fence\n\n**The mental model:** an HTTP\u002F1.1 keep-alive connection is a single ordered byte stream carrying multiple request\u002Fresponse pairs back to back, with no built-in boundary markers between them. The only thing separating \"response A ends here\" from \"response B starts here\" is a promise the server makes in its own headers — `Content-Length: N` (\"read exactly N bytes and stop\") or `Transfer-Encoding: chunked` (a series of self-describing length-prefixed chunks ending in a zero-length chunk). Whoever is reading that stream — a browser, or a reverse proxy multiplexing several clients onto one backend connection — has to take that promise at face value, because the wire gives it nothing else to go on.\n\nThat promise is also the whole attack surface of the **response-splitting \u002F response-desync** bug family (tracked more generally as [CWE-444, \"Inconsistent Interpretation of HTTP Requests\"](https:\u002F\u002Fcwe.mitre.org\u002Fdata\u002Fdefinitions\u002F444.html)): if the declared framing disagrees with the bytes actually sent — say the header claims a `Content-Length` shorter than the real body — the reader stops reading where the header says to, and treats the leftover bytes as the start of the *next* response on the connection. On a connection serving one client, that's merely a parsing bug. On a **shared, pipelined** connection serving several clients' queued requests, those leftover bytes are the beginning of someone else's conversation — which is precisely the \"cross-client\" half of this advisory's name.\n\nNext.js doesn't invent this bug class; it just hands you, via `fetch()`, an unusually easy way to opt into trusting an upstream's framing instead of generating your own. Every reverse proxy and every API gateway has to solve this same problem, and the standard answer is the same everywhere: **never let an upstream's framing headers reach the client verbatim.** Regenerate the response you send, and let your own runtime compute its own framing from the body you actually serve.\n\n## Staged walkthrough: from one `fetch()` call to a cross-client leak\n\n**Stage 1 — the single-request view (looks fine).** One client, one request, one response. `fetch()` returns a `Response`, your handler returns it, the browser renders it. Nothing here reveals the bug, because a single unshared connection has no second response to collide with.\n\n```ts\nconst upstream = await fetch(url)\nreturn upstream\n```\n\n**Key concept:** a `Response` object carries its headers as a live `Headers` instance, and returning it verbatim means every header the upstream sent — including the ones that only make sense on *that* connection, between *that* pair of servers — rides along to the browser.\n\n**Stage 2 — add a shared, pipelined connection.** This is the precondition the advisory names explicitly, not a hypothetical: \"an app sits behind an HTTP\u002F1.1 reverse proxy that permits pipelined response queueing\" on a connection to the backend shared across clients. Picture two requests, from two different browsers, queued through the proxy onto the same keep-alive connection to your Next.js server: request A, then request B, back to back, same socket.\n\n**Stage 3 — the upstream response disagrees with its own framing.** Your Route Handler's `fetch()` call to the internal API gets back a response whose declared length doesn't match its real body — crafted, buggy, or simply mis-proxied upstream of *you*. You forward it unchanged. The reverse proxy, reading strictly by the framing header it was told to trust, stops reading response A's body exactly where that header says to — which is *before* the real end of the bytes Next.js actually wrote to the socket.\n\n**Stage 4 — the leftover bytes become someone else's response.** Whatever Next.js wrote after the point the proxy thought response A ended is still sitting on the connection. The proxy, having already moved on to deliver request B's turn, reads those leftover bytes as the start of *response B* — and hands client B a response built partly or wholly from client A's data. This is the \"disclosure of other clients' responses\" the advisory describes, and depending on exactly how the bytes land, it can go the other way too: a crafted response can *inject* content into a connection it was never meant to answer.\n\n**Key concept:** nothing about steps 3–4 requires a bug in Next.js's own rendering, routing, or caching logic. The entire mechanism lives in the gap between \"what the framing header claims\" and \"what bytes were actually written\" — a gap that only opens because step 1 forwarded an upstream's framing headers instead of generating fresh ones.\n\n## Edge cases\n\n- **The fetch cache, not just Route Handlers.** The advisory's title names both \"App Router route handlers\" and \"the fetch cache\" as paths to this bug. A cached `fetch()` result that gets replayed later carries the same risk if what's replayed includes the original framing headers rather than a freshly computed response — the vulnerable pattern is \"store and replay an upstream response's own header set,\" wherever in your app that happens.\n- **Not every reverse proxy is affected.** The advisory is specific: the precondition is an HTTP\u002F1.1 proxy that does pipelined response queueing on a shared backend connection. A proxy that opens one backend connection per client request, or that terminates HTTP\u002F1.1 and speaks HTTP\u002F2 or HTTP\u002F3 to clients while multiplexing properly on the backend, doesn't have the \"leftover bytes land in someone else's turn\" step that makes this dangerous. If you don't know which your platform does, treat yourself as in scope and patch anyway — the fix costs nothing and the alternative is finding out the hard way.\n- **Managed hosting isn't automatically exempt.** The advisory's own framing is \"self-hosted,\" and some platforms have stated their specific proxy architecture isn't affected. That is a statement about one piece of infrastructure, not a blanket guarantee for every hosting target — verify your own platform's advisory, don't assume.\n- **This is a Moderate-severity, high-complexity bug, not a trivial one.** The CVSS v4 vector lists `AC:H` (high attack complexity) and `AT:P` (attack requirements present) — exploitation needs the specific proxy behavior lined up, not just an internet connection. That earns \"patch promptly,\" not \"panic.\"\n\n## Best practices\n\n- **Never return a fetched `Response` to the client unchanged.** Build your own: read what you need from the upstream (`.json()`, `.text()`, or stream the body if you must), and construct a fresh `Response` with exactly the headers your own API contract requires. Let the runtime compute `Content-Length` or chunk the body itself — don't copy the upstream's framing headers into yours.\n  ```ts\n  const upstream = await fetch(url)\n  const data = await upstream.json()\n  return Response.json(data, {\n    status: upstream.status,\n    headers: { \"cache-control\": \"no-store\" }, \u002F\u002F only headers you intend to set\n  })\n  ```\n- **If you must stream a large body through, still don't trust the upstream's own framing.** Stream `upstream.body` into a response you construct, with headers you set explicitly — not `new Response(upstream.body, { headers: upstream.headers })`, which carries the same risk the advisory describes.\n- **Treat hop-by-hop headers as never-forward, always.** `Connection`, `Transfer-Encoding`, `Content-Length`, `Keep-Alive`: these describe the upstream's own connection to *its* caller, not yours to the browser. If you need to pass through headers wholesale for a legitimate proxy use case, allow-list the ones you actually need instead of spreading everything.\n- **Know whether your reverse proxy pipelines on a shared backend connection.** This is an infrastructure question, not a Next.js one — ask your platform or your ops team, and if you don't get a clear answer, patch and move on regardless.\n- **Patch on a schedule, not on a hunch.** A Moderate, high-complexity CVE like this one is exactly what dependency update automation (Dependabot, Renovate) exists for. Don't wait for a deep-dive to tell you to run `npm install next@latest` — this article is about the mechanism, not a substitute for routine patching.\n\n## FAQ\n\n### Is my app vulnerable if I don't run any Route Handlers?\n\nPossibly still yes, per the advisory's own wording: the fetch cache replaying a previously fetched upstream response is named as a second path to the same bug, independent of whether you write Route Handlers yourself. Patching to 16.4.5 (or 15.5.29) closes both paths; the defensive pattern in this article (never forward upstream framing headers) is the thing to also apply by hand anywhere your own code constructs a response from an upstream fetch.\n\n### Does this affect the Pages Router too?\n\nThe advisory's affected-versions list includes 15.5.28 and below, which predates the App Router being the default, so Pages Router apps that proxy upstream responses through an API route are not automatically exempt from the underlying pattern — the same \"don't forward upstream framing headers\" rule applies there. Check your specific setup against the advisory rather than assuming either router is safe by default.\n\n### Is this the same bug as the `unstable_cache` cross-tenant leak from the same release?\n\nNo — they're two separate advisories in the same November 3, 2026 security release. [GHSA-mfr8-8qww-v76h](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js\u002Fsecurity\u002Fadvisories\u002FGHSA-mfr8-8qww-v76h) (covered in this series' [unstable_cache root-param leak](https:\u002F\u002Fdev.to\u002Fparsajiravand\u002Fnextjs-1645-how-unstablecache-leaked-data-across-root-params-1om0) episode) is a cache-key bug: a `\"use cache\"` function's key didn't account for a root param it read. This one, GHSA-pc58-hwjq-p385, is a connection-level HTTP framing bug with nothing to do with cache keys. Both are fixed by the same 16.4.5 upgrade.\n\n### Do I need a specific reverse proxy to be at risk?\n\nThe advisory names the precondition precisely: an HTTP\u002F1.1 reverse proxy that performs pipelined response queueing over a connection shared by multiple clients to your backend. If you don't control or can't confirm your proxy's behavior, the safe assumption is \"maybe,\" and the fix — upgrading, plus never forwarding upstream framing headers by habit — costs nothing to apply regardless of the answer.\n\n### Was this exploited before it was patched?\n\nThe GitHub security advisory for GHSA-pc58-hwjq-p385 does not claim or document any known exploitation; it describes the vulnerability class, the precondition, and the fixed versions. Treat the absence of a reported incident as exactly that — an absence of a reported incident, not a guarantee.\n\n\u003C!-- playground:start -->\n\n## 🎮 Try it yourself\n\n**[▶️ Open the interactive playground →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-response-injection-forwarded-fetch\u002Fplayground)**\n\n_Runs right in your browser — poke at it and watch the concept react live._\n\n\u003C!-- playground:end -->\n\n## Cheat sheet\n\n| Situation | Do this | Why |\n| --- | --- | --- |\n| Route Handler calls `fetch()` and wants to send the result to the browser | `const data = await upstream.json(); return Response.json(data, { status: upstream.status })` | You build fresh framing headers; nothing from upstream's `Content-Length`\u002F`Transfer-Encoding` survives |\n| You must stream a large upstream body through | `return new Response(upstream.body, { status: upstream.status, headers: pickedHeaders })` with `pickedHeaders` an explicit allow-list you built yourself | Streaming is fine; forwarding the upstream `Headers` object wholesale is the risky part |\n| Replaying a previously fetched response from your own cache | Store the data, not the raw `Response`\u002F`Headers`; reconstruct the response at serve time | A stored response can carry the same stale\u002Fmismatched framing the advisory describes |\n| Checking if you're affected | `npm view next version` — anything 16.0.0–16.4.4 or ≤15.5.28 is affected | Advisory GHSA-pc58-hwjq-p385, CVE-2026-119348 |\n| Fixing it | `npm install next@latest` (or pin ≥16.4.5 \u002F ≥15.5.29) | Confirmed-patched versions per the official advisory |\n| Headers that should never be copied from an upstream response | `Content-Length`, `Transfer-Encoding`, `Connection`, `Keep-Alive` | These describe the upstream's connection to *its* caller, not yours to the browser |\n\n\n\u003C!-- quiz:start -->\n\n## 🧠 Test yourself\n\nThink it clicked? **[Take the 8-question quiz →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-response-injection-forwarded-fetch\u002Fquiz)**\n\n_Instant feedback, a hint on every question, and an explanation for each answer — right or wrong._\n\n\u003C!-- quiz:end -->\n## Key takeaways\n\n- **An HTTP\u002F1.1 connection has no built-in message boundaries** — only the framing headers a server declares (`Content-Length`, `Transfer-Encoding`). A shared, pipelined connection makes a framing mismatch a cross-client problem, not just a parsing one.\n- **CVE-2026-119348 isn't a Next.js logic bug — it's response splitting, reached via `fetch()`.** Any Route Handler or cached-fetch replay that forwards an upstream `Response` unchanged carries its framing headers along for the ride.\n- **The fix that matters beyond the patch:** never forward an upstream response's framing headers to the client. Build your own `Response`, from data you've read, with headers you chose — every time you proxy.\n- **Upgrade to 16.4.5 \u002F 15.5.29**, and audit any Route Handler or cache-replay code that does `return upstreamResponse` or spreads `upstream.headers` wholesale.\n\nYou patched this one with an `npm install`. The pattern that made it possible — trusting someone else's framing because `fetch()` made it one line to forward — is still sitting in a lot of codebases that have never heard of this CVE and never will, until their own proxy starts pipelining. Go check your Route Handlers.\n\nWhat's the first `return upstream` in your own code that you're now going to rewrite?\n\n\u003C!-- related:start -->\n\n## 📚 Read next\n\n- [Next.js 16.4.5: How unstable_cache Leaked Data Across Root Params](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-unstable-cache-root-params-leak)\n- [Next.js proxy.ts Explained (with Cheat Sheet)](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-middleware-to-proxy-network-boundary)\n- [Next.js Route Handlers: GET Stopped Caching in 15 — How to Cache in 16](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-route-handlers-caching-streaming)\n\n\u003C!-- related:end -->\n\n---\n\n🚀 **Want more like this?** Every guide, playground, and quiz lives on **[bestpractic.org](https:\u002F\u002Fbestpractic.org\u002F)** — open it and **[sign up free](https:\u002F\u002Fbestpractic.org\u002F)** so the next one finds you.\n\n*Thanks for reading! Let's stay connected:*\n\n- ⭐ **GitHub** — follow me and star the projects: [github.com\u002Fparsajiravand](https:\u002F\u002Fgithub.com\u002Fparsajiravand)\n- 💬 **Discord** — join the frontend best-practices community: [discord.gg\u002Fd9KRhuAwQ](https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ)\n- 📸 **Instagram** — frontend best practices, daily: [@bestpractice___](https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F)",{"title":111,"canonical":405,"description":112},"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnextjs-weekly-response-injection-forwarded-fetch","01a21cc5-78fc-7169-bbde-ded2153f7511",{"name":408,"part":108,"total":108,"items":409},"Next.js Deep Dive",[410,414,419,423,427,431,435,439,443,447,452,456,460,465],{"slug":411,"title":412,"publishedAt":413,"readingMinutes":108},"nextjs-weekly-cache-components-explained","Next.js Cache Components Explained (with Cheat Sheet)","2026-09-01T11:24:15.087Z",{"slug":415,"title":416,"publishedAt":417,"readingMinutes":418},"nextjs-weekly-server-actions-mutations-security","Next.js Server Actions: Mutations & Security (Cheat Sheet)","2026-09-08T10:57:00.975Z",15,{"slug":420,"title":421,"publishedAt":422,"readingMinutes":108},"nextjs-weekly-parallel-intercepting-routes-modals","Next.js Parallel & Intercepting Routes: Modals Done Right","2026-09-15T17:50:47.218Z",{"slug":424,"title":425,"publishedAt":426,"readingMinutes":115},"nextjs-weekly-middleware-to-proxy-network-boundary","Next.js proxy.ts Explained (with Cheat Sheet)","2026-09-22T19:36:08.416Z",{"slug":428,"title":429,"publishedAt":430,"readingMinutes":418},"nextjs-weekly-route-handlers-caching-streaming","Next.js Route Handlers: GET Stopped Caching in 15 — How to Cache in 16","2026-09-29T09:16:08.176Z",{"slug":432,"title":433,"publishedAt":434,"readingMinutes":108},"nextjs-weekly-streaming-metadata-head","Next.js Streaming Metadata: Why Your `\u003Chead>` Looks Incomplete","2026-10-06T06:10:31.468Z",{"slug":436,"title":437,"publishedAt":438,"readingMinutes":418},"nextjs-weekly-image-priority-quality-changes","Next.js 16 Image: priority Deprecated, quality Now Allowlisted","2026-10-13T06:10:29.815Z",{"slug":440,"title":441,"publishedAt":442,"readingMinutes":108},"nextjs-weekly-instant-navigations-partial-prefetching","Next.js 16.3 Instant Navigations: How Partial Prefetching Works","2026-10-20T06:10:59.936Z",{"slug":444,"title":445,"publishedAt":446,"readingMinutes":108},"nextjs-weekly-updatetag-vs-revalidatetag","Next.js 16 updateTag vs revalidateTag: What Changed","2026-10-27T06:11:02.727Z",{"slug":448,"title":449,"publishedAt":450,"readingMinutes":451},"nextjs-weekly-ensurestatic-locks-static-output","Next.js 16.4 ensureStatic: Locking Routes Fully Static","2026-11-03T06:10:26.449Z",13,{"slug":453,"title":454,"publishedAt":455,"readingMinutes":451},"nextjs-weekly-unstable-cache-root-params-leak","Next.js 16.4.5: How unstable_cache Leaked Data Across Root Params","2026-11-10T20:39:47.146Z",{"slug":457,"title":458,"publishedAt":459,"readingMinutes":451},"nextjs-weekly-error-retry-vs-reset","Next.js 16.3 error.js: retry vs reset Aren't Interchangeable","2026-11-27T11:42:24.474Z",{"slug":461,"title":462,"publishedAt":463,"readingMinutes":464},"nextjs-weekly-use-cache-remote-vs-private","Next.js 16 use cache: remote vs use cache: private","2026-11-27T11:47:29.944Z",16,{"slug":46,"title":111,"publishedAt":114,"readingMinutes":108},{"id":467,"locked":18},"01a21cc5-7929-7231-ac37-d5ccb81c3cfb",[469],{"id":45,"slug":46,"title":48,"_count":470},{"questions":51},[472],{"locale":13,"slug":46},{"id":45,"slug":46,"title":48,"_count":474,"questionCount":51},{"questions":51},[]]