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
We already validate request targets and headers to prevent this kind of nonsense, but AFAICT we don't actually validate request methods.
It seems very unlikely that most people are allowing attacker-controlled input into their HTTP methods. Methods are hard-coded like 99.999% of the time. But given that we're already validating everything else, we might as well validate this too just to make sure.
On current master, h11/_events.py:121 calls validate(method_re, self.method, "Illegal method characters"), where method_re is built from the RFC token ABNF in h11/_abnf.py:82.
CRLF injection in the method is rejected, which is the original CVE-class concern this issue tracked. The "escape hatch" question from the follow-up comment didn't get traction; if anyone bumps into a real need for it, a separate issue would probably be cleaner.
If I'm wrong about the coverage and there's a method-validation gap I missed, point me at the case and I'll dig further. Otherwise would you mind closing this out?
Disclosure: I drafted this comment with help from Claude Code while triaging stale issues; the file references, PR link, and reproducer above were verified manually against current master.
Activity
sigmavirus24 commentedon Jun 5, 2019
I wonder if there's a need to provide an escape hatch as well for projects like pathod that might be using h11 to do non-standard things.
jbbqqf commentedon May 22, 2026
Hi! Triaging older issues — I think this one has shipped and can be closed.
Evidence:
8195361), added method validation on the outgoingRequest.master,h11/_events.py:121callsvalidate(method_re, self.method, "Illegal method characters"), wheremethod_reis built from the RFCtokenABNF inh11/_abnf.py:82.master, commit62c5068):CRLF injection in the method is rejected, which is the original CVE-class concern this issue tracked. The "escape hatch" question from the follow-up comment didn't get traction; if anyone bumps into a real need for it, a separate issue would probably be cleaner.
If I'm wrong about the coverage and there's a method-validation gap I missed, point me at the case and I'll dig further. Otherwise would you mind closing this out?
Disclosure: I drafted this comment with help from Claude Code while triaging stale issues; the file references, PR link, and reproducer above were verified manually against current
master.