Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consideration for HTTP/3 Security #1798

Open
ImanSharaf opened this issue Dec 1, 2023 · 12 comments
Open

Consideration for HTTP/3 Security #1798

ImanSharaf opened this issue Dec 1, 2023 · 12 comments
Assignees
Labels
2) Awaiting response Awaiting a response from the original poster Community needed This issue will not be progressed without community input. Will be closed if stale. _5.0 - Not blocker This issue does not block 5.0 so if it gets addressed then great, if not then fine.

Comments

@ImanSharaf
Copy link
Collaborator

With the growing adoption of HTTP/3, it's crucial to address security concerns specific to its protocols and implementations. One key area is the header compression mechanism used in HTTP/3, known as QPACK. While QPACK enhances efficiency, it may also introduce vulnerabilities similar to those seen with HTTP/2's HPACK, particularly compression-based security attacks like CRIME and BREACH.

To start this discussion around HTTP/3 security, I want to propose this:

  • Verify that HTTP/3 header compression (QPACK) is securely implemented to prevent compression-based attacks such as CRIME or BREACH. This verification should include checks to ensure that sensitive data is not subject to unsafe compression techniques that could expose information through side channels.
@elarlang elarlang added the 1) Discussion ongoing Issue is opened and assigned but no clear proposal yet label Dec 2, 2023
@elarlang
Copy link
Collaborator

elarlang commented Dec 3, 2023

I tried to get more into the issue, searched some materials, and found to be worth reading:

Then I found a blog post:

So, instead of keeping digging myself, I hope @Sjord can give us a quick overview:

  • for me it seems, that mentioned attacks are not HTTP/3 specific
  • are they still relevant?
  • there seems to be plenty of pre-conditions for the attack to work - what are those?

@elarlang elarlang added the Community needed This issue will not be progressed without community input. Will be closed if stale. label Dec 3, 2023
@Sjord
Copy link
Contributor

Sjord commented Dec 11, 2023

A compression side channel attack is possible when some content contains both a secret and some user input and is then compressed. The assumption is that the attacker can observe the size of the compressed content, but not the content itself (because it is encrypted). Compression is more effective if the user input is more similar to the secret, so if the size decreases the attacker knows he is on the right track.

BREACH targets compression of the request content. By sending many requests through a CSRF-like setup, and observing the size, a secret value in the request content (typically the CSRF token) can be guessed approx. one bit at a time.

HPACK and QPACK have some mitigations against this, but do not offer total protection. Headers are not compressed at character-level, but headers with the same value are still compressed. This makes it impossible to guess character by character, so this makes the attack much harder.

From RFC 9204:

QPACK mitigates, but does not completely prevent, attacks modeled on CRIME by forcing a guess to match an entire field line rather than individual characters. An attacker can only learn whether a guess is correct or not, so the attacker is reduced to a brute-force guess for the field values associated with a given field name.

The usual recommendations of using sufficiently long keys and CSRF tokens would adequately prevent against a brute-force attack. We could also recommend to be cautious when using user-supplied information as header value. However, I think adding a requirement to never include user content in a request header may be a bit too much.

The typical attack scenario for BREACH was performing many CSRF-like requests. Same-site cookies make this scenario a lot harder. A possible attack scenario is when a web application accesses another service: it includes the API key in the request header, and also forwards the client's User-Agent header or some other header. However, the attacker then also needs a MitM position to observe the size of the compressed requests.

introduce vulnerabilities similar to those seen with HTTP/2's HPACK

Do you have more specific information or a source for this? I was under the impression that HPACK in HTTP/2 was not vulnerable to compression attacks.

@jmanico
Copy link
Member

jmanico commented Dec 11, 2023 via email

@elarlang elarlang removed their assignment Dec 11, 2023
@elarlang elarlang added the 2) Awaiting response Awaiting a response from the original poster label Dec 11, 2023
@tghosth
Copy link
Collaborator

tghosth commented Jan 24, 2024

@Sjord so to be clear, are we saying that HTTP/3 is vulnerable to this attack in a way that HTTP/2 is not?

@tghosth tghosth added _5.0 - prep This needs to be addressed to prepare 5.0 and removed 1) Discussion ongoing Issue is opened and assigned but no clear proposal yet labels Jan 24, 2024
@Sjord
Copy link
Contributor

Sjord commented Jan 24, 2024

No, I don't think there is a large difference between 2 and 3 regarding security against compression side channel attacks. How did you get that idea?

@tghosth
Copy link
Collaborator

tghosth commented Jan 24, 2024

Maybe I misunderstood what @ImanSharaf wrote here: #1798 (comment)

@ImanSharaf is there anything HTTP/3 specific here or do we need a more generic requirement?

@danielcuthbert
Copy link
Collaborator

I don't think there exists a need yet for specific mentions of HTTP/3 in this standard, as we don't delve deep into the underlying webserver part. However, there might be a need at some point and I'm open to any suggestions as to what

@tghosth
Copy link
Collaborator

tghosth commented Apr 30, 2024

I am going to leave this as open but not blocking for 5.0

@tghosth tghosth added _5.0 - Not blocker This issue does not block 5.0 so if it gets addressed then great, if not then fine. and removed _5.0 - prep This needs to be addressed to prepare 5.0 labels Apr 30, 2024
@ImanSharaf
Copy link
Collaborator Author

@tghosth this requires an extensive research, thank you.

@elarlang
Copy link
Collaborator

Is it fair to say that we don't have requirement to add on the topic and we can close this issue?

@randomstuff
Copy link

(I don't believe there are requirements about compression side channels in general and BREACH in particular, are they?)

@tghosth
Copy link
Collaborator

tghosth commented Oct 28, 2024

@elarlang it is currently marked as a non-blocker so happy to leave it open for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2) Awaiting response Awaiting a response from the original poster Community needed This issue will not be progressed without community input. Will be closed if stale. _5.0 - Not blocker This issue does not block 5.0 so if it gets addressed then great, if not then fine.
Projects
None yet
Development

No branches or pull requests

7 participants