Skip to content

Strip whitespace between field-name and the : #7176

Closed

Description

@bryancall

We MUST strip whitespace between field-name and the : on servers responses.

This is the PR that changed how we handle spaces: #6794

08:49:30 bart:(9.0.x)~/dev/apache/trafficserver/build-Linux$ tail -1 /usr/local/etc/trafficserver/remap.config
map /  https://iqconnect.house.gov/
08:52:16 bart:(9.0.x)~/dev/apache/trafficserver/build-Linux$ curl -D - -so /dev/null http://127.0.0.1:8080/iqextranet/Customers/VA99LD/cherry-blossom-facts.jpg | grep Protection
X-XSS-Protection : 1; mode=block
X-XSS-Protection: 1

Activity

  1. added this to the 9.0.0 milestone on Sep 9, 2020
  2. self-assigned this
    on Sep 9, 2020
  3. bryancall commented on Sep 9, 2020

    @bryancall
    ContributorAuthor

    https://tools.ietf.org/html/rfc7230#section-3.2.4

    No whitespace is allowed between the header field-name and colon. In
    the past, differences in the handling of such whitespace have led to
    security vulnerabilities in request routing and response handling. A
    server MUST reject any received request message that contains
    whitespace between a header field-name and colon with a response code
    of 400 (Bad Request). A proxy MUST remove any such whitespace from a
    response message before forwarding the message downstream.

  4. bryancall commented on Sep 9, 2020

    @bryancall
    ContributorAuthor

    With #6794 reverted I get:

    09:54:53 bart:(9.0.x)~/dev/apache/trafficserver/build-Linux$ curl -D - -so /dev/null http://127.0.0.1:8080/iqextranet/Customers/VA99LD/cherry-blossom-facts.jpg
    HTTP/1.1 502 Invalid HTTP Response
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions