Live data from Hacker News

Next.js version 15.2.3 has been released to address a security vulnerability

nextjs.org

21–30 of 220 posts

Re: Next.js version 15.2.3 has been released to address a security vulnerability

#21

> Next.js uses an internal header x-middleware-subrequest to prevent recursive requests from triggering infinite loops. The security report showed it was possible to skip running Middleware, which could allow requests to skip critical checks—such as authorization cookie validation—before reaching routes.

Not a web dev, so struggling a bit to understand this. Are they saying they had a special flag that allowed requests to bypass auth, intended to be used by calls generated internally? And someone figured out you could just send that on the first request and skip auth entirely?

If I’m reading the code right, it support their hybrid model where your code can run in three places: the user’s browser, Vercel’s edge, and an actual server. It looks like the idea was for when code in the edge context to be able to call the server faster but it was not protected to keep anyone else from calling it directly.

If I he for that right, this is a security review failure since people perennially try that optimization and have it end poorly for reasons like this. It’s safer, and almost always less work, to treat all calls equally and optimize if needed rather than having to support an “internal” call type over the same interface.

Re: Next.js version 15.2.3 has been released to address a security vulnerability

#22

> Next.js uses an internal header x-middleware-subrequest to prevent recursive requests from triggering infinite loops. The security report showed it was possible to skip running Middleware, which could allow requests to skip critical checks—such as authorization cookie validation—before reaching routes.

Not a web dev, so struggling a bit to understand this. Are they saying they had a special flag that allowed requests to bypass auth, intended to be used by calls generated internally? And someone figured out you could just send that on the first request and skip auth entirely?

As I understand it, the middleware runs before a request hits a page or API route.. so to avoid infinite loops from internal subrequests (URL rewrites, etc), Next.js tags them with the x-middleware-subrequest header. This tells the runtime to skip middleware for those requests and proceed directly to the target. Unfortunately this also works externally.

Re: Next.js version 15.2.3 has been released to address a security vulnerability

#25
Oh my word:

The exploit involves crafting HTTP requests containing the malicious header:

GET /protected-route HTTP/1.1 Host: vulnerable-app.com x-middleware-subrequest: true

So... just adding a "x-middleware-subrequest: true" header bypasses auth? Am I understanding this correctly?

Re: Next.js version 15.2.3 has been released to address a security vulnerability

#26

Vercel’s reputation is so cooked. Jeez.

I mean their whole product is geared towards bad developers. And I don't say that loosely. I literally mean bad developers. Developers who do not understand what a product is and how learning something slightly more difficult such as servers and things of that nature that actually can make for a better product.

Re: Next.js version 15.2.3 has been released to address a security vulnerability

#28

We opted for self-hosted next.js as the architecture for the web app we are building because we believed a lot of the hype. The more comments I read about it in HN, the less comfortable I feel about this decision.

> because we believed a lot of the hype

Never buy the hype.

Buy boring and tested.

Re: Next.js version 15.2.3 has been released to address a security vulnerability

#29

Vercel’s reputation is so cooked. Jeez.

I mean their whole product is geared towards bad developers. And I don't say that loosely. I literally mean bad developers. Developers who do not understand what a product is and how learning something slightly more difficult such as servers and things of that nature that actually can make for a better product.

My biggest concern about these so-called “isomorphic frameworks” is they’re trying to abstract away the server/client distinction. I don’t see how that doesn’t result in tons of security bugs. Or maybe I’m just an old fart.

Re: Next.js version 15.2.3 has been released to address a security vulnerability

#30

Vercel’s reputation is so cooked. Jeez.

I mean their whole product is geared towards bad developers. And I don't say that loosely. I literally mean bad developers. Developers who do not understand what a product is and how learning something slightly more difficult such as servers and things of that nature that actually can make for a better product.

What product alternative to Nextjs would you say is targeted towards "good developers"?
Post reply on HN