News for hackers. Stuff that matters.
Re:Parsing JSON is a Minefield by ars on Wednesday October 26, 2016 @12:34PM (#12797921)
> and dies on the JSON decode

That's the part I don't get. Once the code dies it's done. What exactly can you do now, if no code is even running?

Re:Parsing JSON is a Minefield by SomeStupidPoint on Wednesday October 26, 2016 @12:59PM (#12798199)
The steps are the following:

1. Parse user.

2. Parse password.

3. Create session object from user and password.

4. Parse JSON. (Crashes here.)

5. Update session and do some other security stuff.

The problem is that they're creating a persistent session object ahead of when the JSON parameters are being decoded, which leaves a (partially initialized, persisting-outside-of-function) session object without having gone through the full authentication flow.

The problem is that they're creating permanent objects ahead of a full validation on the data necessary to actually properly initialize the object.

(I think the OP may have been a little vague because that's probably specific enough to identify the vuln with a scanner and a hunch.)

Re:Parsing JSON is a Minefield by umbrai_nation on Wednesday October 26, 2016 @10:16PM (#12802442)
Wait, so it creates a privileged session before verifying the password? That's your problem right there. A crash in the JSON processor (or anywhere else) is a minor blip compared to this godzilla bug of granting access before it's been earned.
Re:Parsing JSON is a Minefield by mathw on Thursday October 27, 2016 @04:25AM (#12803603)
Spot on! But if the JSON parser couldn't crash on malformed input, that kind of whopping mistake would be a lot harder to exploit.
Re:Parsing JSON is a Minefield by mort96 on Wednesday October 26, 2016 @04:48PM (#12800370)
Remember, it's PHP. Code will be running again on the next request. Only the process (or thread or whatever) handling the request with the invalid JSON crashes, and it only crashes after producing a persistent session; the next request, a different process/thread/whatever will run code, but the session from the previous request still exists.
Re:Parsing JSON is a Minefield by KayEss on Wednesday October 26, 2016 @11:17PM (#12802673)
I still don't get it. The browser gets the session cookie even though the request processing crashed? Or does another request manage to pick up the session that was dropped from the crashed request?

I don't do PHP. It just sounds incredible to me that so little isolation seems to exist.