VDB
Sign up
MEDIUM6.0

GHSA-f3mh-rxg3-f5g2

Next.js: HttpOnly cookie exposure through internal response header on Next.js Edge runtime routes

Quick fix

GHSA-f3mh-rxg3-f5g2 — next: upgrade to the fixed version with the command below.

npm install next@15.5.29

Details

Next.js applications that set cookies through `NextResponse` on Edge runtime routes — App Router route handlers and Pages Router Edge API routes — send an internal `x-middleware-set-cookie` header in the public response, duplicating the cookie value and its attributes. This makes HttpOnly cookies, such as session tokens, readable by JavaScript running on the same origin when an application sets a sensitive cookie on an affected response.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm/next
Introduced in: 15.0.0Fixed in: 15.5.29
Fixnpm install next@15.5.29
npm/next
Introduced in: 16.0.0Fixed in: 16.4.5
Fixnpm install next@16.4.5

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:npm/next"]}'