Skip to content

Harden against HTTP Desync attacks #3444

Open
@Sytten

Description

@Sytten

Problem
HTTP Desync attacks are pretty bad and there are a lot of bad/permissive http implementations out there that act as proxies.
I didn't see any discussion / tests of hyper surrounding that so I wanted to start the discussion around the topic given that hyper is now 1.0 (and used in production in a lot of places).

Ideas

  • A suite of tests to demonstrate that an hyper server reacts as best it can (given it doesn't control the proxy)
  • Creating a flag for hardened/more strict version of hyper (server mostly)

For the second point, I would take a lot of work that has been done by AWS already in https://github.com/aws/http-desync-guardian and try to incorporate it in hyper where it makes sense. This includes going more strict than the spec to avoid confusions.

Things like ignoring a CL when a TE is present is risky (even if the spec says that it must be ignored) since a proxy might very well not ignore the CL. So even if hyper is "correct", that won't prevent a leak. Under an hypothetical strict flag, this would result in the request being rejected.

hyper/src/proto/h1/role.rs

Lines 251 to 253 in 210bfaa

if is_te {
continue;
}

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-rfcBlocked: More comments would be useful in determine next steps.C-featureCategory: feature. This is adding a new feature.S-waiting-on-authorStatus: waiting on the author to provide more info, or make changes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions