You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Historically, HTTP header field values could be extended over multiple lines by preceding each extra line with at least one space or horizontal tab (obs-fold). This specification deprecates such line folding except within the message/http media type (Section 8.3.1). A sender MUST NOT generate a message that includes line folding (i.e., that has any field-value that contains a match to the obs-fold rule) unless the message is intended for packaging within the message/http media type.
A server that receives an obs-fold in a request message that is not within a message/http container MUST either reject the message by sending a 400 (Bad Request), preferably with a representation explaining that obsolete line folding is unacceptable, or replace each received obs-fold with one or more SP octets prior to interpreting the field value or forwarding the message downstream.
The parser seems unaware of the existence of this problem, and making a request with obs-fold results in multiple headers seen by Iodine.
Thanks for pointing this out! It looks important! 🤩🤩🤩🙏🏻🙏🏻🙏🏻
I bet that finding this issue wasn't easy 👏🏻👏🏻👏🏻
I think this issue could have raised some interesting security concerns if iodine was used as a proxy instead of an application server (header smuggling could occur if whitespace removal was performed)...
I'm off to read more about this issue and see what I can do to fix it.
Hey @boazsegev, I have found a couple more issues while doing due diligence on Iodine. Please let me know if I can provide more details.
I think this issue could have raised some interesting security concerns if iodine was used as a proxy instead of an application server (header smuggling could occur if whitespace removal was performed)...
If multiple HTTP-aware components are stacked and at least two disagree about the meaning of the message, problems are bound to happen. I was specifically looking for ways to smuggle requests in and found unrelated issues.
When coding iodine I made the (poor?) assumption that it would always "hide" behind nginx, so I omitted some conformity tests from the parser (assuming these would be handled before the request arrives).
However, you are right in your approach and I am working on a fix for these issues. Since the parser is written in C, I might also consider replacing it with an open source (MIT licensed) alternative, especially if it is fast and keeps the same behavior (i.e., converts header names to lower case, allow UTF-8 header names, etc').
Very nice and creative work on attempting all these attack vectors and variations 👍🏻
System Information
Description
The HTTP parser is in violation of RFC7230§3.2.4:
The parser seems unaware of the existence of this problem, and making a request with obs-fold results in multiple headers seen by Iodine.
Rack App to Reproduce
Testing code
Expected behavior
The request should either be discarded with HTTP/400, or header folding should be processed correctly, as per the linked RFC.
Actual behavior
The request is accepted and the response is
demonstrating that the rest of the value of header X was understood as a header with name
␣A
, which is incorrect.The text was updated successfully, but these errors were encountered: