News for hackers. Stuff that matters.
Re:CRLF is obsolete and should be abolished by hifromwork on Sunday October 13, 2024 @06:09PM (#41832137)
As the parent mentioned, it's security critical that every HTTP parser in the world - including every middleware, proxy, firewall, WAF - parses the headers in the same way. If you write a HTTP parser for a server application it's imperative you don't introduce random inconsistences with the standard (I can't believe I have to write this).

On the other hand, as a client, it's OK to send malformed requests, as long as you're prepared that they may fail. But it's a weird flex, legacy protocols have many warts, why die on this particular hill.

Re:CRLF is obsolete and should be abolished by tptacek on Sunday October 13, 2024 @06:20PM (#41832201)
That appears to be an argument in favor of accepting bare-0ah, since as a positive statement that is the situation on the Internet today.
Re:CRLF is obsolete and should be abolished by theamk on Sunday October 13, 2024 @08:12PM (#41832905)
[delayed]
Re:CRLF is obsolete and should be abolished by tptacek on Sunday October 13, 2024 @08:24PM (#41832974)
I mean the safest thing would be to send an RST as soon as you see a SYN for 80/tcp.
Re:CRLF is obsolete and should be abolished by theamk on Sunday October 13, 2024 @10:31PM (#41833686)
That would have a severe downside of not letting your customers access your website.

Fast-abort on bare-0ah will still be compatible with all browsers and major http clients, thus providing extra mitigations practically for free.

Re:CRLF is obsolete and should be abolished by RedShift1 on Sunday October 13, 2024 @08:59PM (#41833159)
Wouldn't not replying at all be the safest?
Re:CRLF is obsolete and should be abolished by MobiusHorizons on Sunday October 13, 2024 @11:32PM (#41833940)
If you expect to be behind a reverse proxy that manages internal headers for you (removes them on incoming requests, and adds them based on internal criteria) then accepting bare 0x0a newlines could be a security vulnerability, as a malicious request could sneak an internal header that would not be stripped by the reverse proxy.
Re:CRLF is obsolete and should be abolished by Smar on Monday October 14, 2024 @05:19PM (#41842146)
Only in the case the reverse proxy does not handle bare 0a newlines?
Re:CRLF is obsolete and should be abolished by inopinatus on Monday October 14, 2024 @01:48AM (#41834573)
That was already motivated by Postel's Law. It's a step beyond to change what the strict form is; relying on the same to justify unilaterally transposing the form is asking too much of middlebox implementations of just about any line-oriented protocol, and possible violates Postel's Law itself by asserting the inverse.
Re:CRLF is obsolete and should be abolished by tptacek on Monday October 14, 2024 @03:13AM (#41835014)
I don't believe in Postel's Law, but I also don't believe in reverential adherence to standards documents. Make good engineering decisions on their own merits. This article is right: CRLF is dumb. You know who agrees with me about that? The IETF, in their (very old) informational RFC about the origins of CRLF in their protocols.
Re:CRLF is obsolete and should be abolished by inopinatus on Monday October 14, 2024 @09:00PM (#41843876)
Yes, CRLF is dumb. Trying to justify the problem seems unnecessary, it's widely acknowledged. A productive inquiry looks at why fixing it didn't happen yet. Don't confuse that line of thought for calling for more failure.

This is unrealistic, though:

> I don't believe in Postel's Law

All the systems around us that work properly do believe in it, and they will continue to do so. No-one who writes MTAs or reverse proxies &c is gonna listen to the wolves howling at the moon for change when there's no better plan that "ram it through unilaterally". Irrespective of what any individual may believe, Postel's Law remains axiomatic in protocol design & implementation.

More constructively, it may be that line-oriented protocols will only move towards change when they can explicitly negotiate line termination preferences during the opening handshake/banner/key exchange etc, which inevitably means a protocol revision in every case and very careful consideration of when CRLF is passed through anyway (e.g. email body).

Re:CRLF is obsolete and should be abolished by tptacek on Tuesday October 15, 2024 @10:49PM (#41855135)
Hold on: if you do believe in Postel's Law, you agree with me: just send newlines.
Re:CRLF is obsolete and should be abolished by account42 on Monday October 14, 2024 @06:00AM (#41835964)
> As the parent mentioned, it's security critical that every HTTP parser in the world - including every middleware, proxy, firewall, WAF - parses the headers in the same way. If you write a HTTP parser for a server application it's imperative you don't introduce random inconsistences with the standard (I can't believe I have to write this).

No it isn't, at least not critical to all those parsers. My HTTP server couln't care less if some middle boxes that people go through are less or more strict in their HTTP parsing. This only becomes a concern when you operate something like a reverse proxy AND implement security-relevant policies in that proxy.