Skip to content
Snippets Groups Projects
  • Daniel Axtens's avatar
    870b9475
    net/http: Error out on headers with LF without CR · 870b9475
    Daniel Axtens authored
    
    In a similar vein to the previous patch, parse_line() would write
    a NUL byte past the end of the buffer if there was an HTTP header
    with a LF rather than a CRLF.
    
    RFC-2616 says:
    
      Many HTTP/1.1 header field values consist of words separated by LWS
      or special characters. These special characters MUST be in a quoted
      string to be used within a parameter value (as defined in section 3.6).
    
    We don't support quoted sections or continuation lines, etc.
    
    If we see an LF that's not part of a CRLF, bail out.
    
    Fixes: CVE-2022-28734
    
    Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
    Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
    870b9475
    History
    net/http: Error out on headers with LF without CR
    Daniel Axtens authored
    
    In a similar vein to the previous patch, parse_line() would write
    a NUL byte past the end of the buffer if there was an HTTP header
    with a LF rather than a CRLF.
    
    RFC-2616 says:
    
      Many HTTP/1.1 header field values consist of words separated by LWS
      or special characters. These special characters MUST be in a quoted
      string to be used within a parameter value (as defined in section 3.6).
    
    We don't support quoted sections or continuation lines, etc.
    
    If we see an LF that's not part of a CRLF, bail out.
    
    Fixes: CVE-2022-28734
    
    Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
    Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>