News for hackers. Stuff that matters.
Re:CRLF is obsolete and should be abolished by michaelmior on Sunday October 13, 2024 @04:55PM (#41831506)
We're talking about servers and clients here. The best way to ensure things work is to adhere to an established protocol. Aside from saving a few bytes, there doesn't seem to be any good reason to deviate.
Re:CRLF is obsolete and should be abolished by Aeolun on Sunday October 13, 2024 @08:16PM (#41832929)
Well, you can achieve the desired behavior in all situations by ignoring CR and treating any seen LF as NL.

I just don’t see why you’d not want to do that as the implementer. If there’s some way to exploit that behavior I can’t see it.

Re:CRLF is obsolete and should be abolished by immibis on Monday October 14, 2024 @08:15AM (#41836805)
The exploit is that your request went through a proxy which followed the standard (but failed to reject the bare NL) and the client sent a header after a bare NL which you think came from the proxy but actually came from the client - such as the client's IP address in a fake X-Forwarded-For, which the proxy would have removed if it had parsed it as a header.

This attack is even worse when applied to SMTP because the attacker can forge emails that pass SPF checking, by inserting the end of one message and start of another. This can also be done in HTTP if your reverse proxy uses a single multiplexed connection to your origin server, allowing attackers to snoop other people's responses or forge requests.

Re:CRLF is obsolete and should be abolished by Aeolun on Monday October 14, 2024 @07:39PM (#41843394)
Thanks, that was actually a very clear description of the problem!

The problem here is not to use one or the other, but to use a mix of both.

Re:CRLF is obsolete and should be abolished by immibis on Tuesday October 15, 2024 @09:37AM (#41848471)
And the standard is CRLF, so you're either following the standard or using a mix.
Re:CRLF is obsolete and should be abolished by tptacek on Sunday October 13, 2024 @05:08PM (#41831609)
I'm saying the consistency that Filippo says our security depends on doesn't really seem to exist in the world, which hurts the persuasiveness of that particular argument in favor of consistency.
Re:CRLF is obsolete and should be abolished by dwattttt on Sunday October 13, 2024 @05:35PM (#41831837)
But no one expects 0ah to be sufficient. Change that expectation, and now you have to wonder if your middleware and your backend agree on whether the middleware filtered out internal-only headers.
Re:CRLF is obsolete and should be abolished by tptacek on Sunday October 13, 2024 @05:45PM (#41831921)
Yeah, I'm not certain that this is a real issue. It might be? Certainly, I'm read in to things like TECL desync. I get the concern, that any disagreement in parsing policies is problematic for HTTP because of middleboxes. But I think the ship may have sailed on 0ah, and that it may be the case that you simply have to build HTTP systems to be bare-0ah-tolerant if you want your system to be resilient.
Re:CRLF is obsolete and should be abolished by dwattttt on Sunday October 13, 2024 @07:50PM (#41832774)
But what's bare-0ah-tolerant? Accepting _or_ ignoring bare 0ah's means you need to ensure all your moving parts agree, or you end up in the "one bit thinks this is two headers, others think it's one header".

The only situation where you don't need to know two policies match is when one of the policies rejects one of the combinations outright. Probably. Maybe.

EDIT: maybe it's better phrased as "all parts need to be bare-0ah-strict". But then it's fine if it's bare-0ah-reject; they just need to all be strict, one way or the other.

Re:CRLF is obsolete and should be abolished by immibis on Monday October 14, 2024 @04:22AM (#41835413)
Security also doesn't exist as much as we'd like it to, which doesn't excuse making it exist even less.
Re:CRLF is obsolete and should be abolished by Ekaros on Sunday October 13, 2024 @05:11PM (#41831637)
There is very good reasons not to deviate as mismatch in various other things that can or are not on the path can affect things. Like reverse proxies, load balancers and so on.