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

HPACK Security Considerations #517

Merged
merged 1 commit into from
Jun 13, 2014
Merged

HPACK Security Considerations #517

merged 1 commit into from
Jun 13, 2014

Conversation

martinthomson
Copy link
Collaborator

I have written what I think is a slightly more robust Security Consideration for HPACK. This covers:

  • the attack in the general sense,
  • how the attack might apply in HPACK and HTTP,
  • particular areas of concern,
  • how HPACK inherently mitigates these attacks,
  • what environments might need additional mitigation, and
  • some suggested mitigation strategies.

Mitigation strategies that I have described are:

  • actor-based isolation (a generalized application of the origin isolation principle)
  • destroy values on failed guesses (thanks here to Adam Barth for the idea), either probabilistically, or based on a count, with a recommendation that shorter values be made harder to guess
  • specific protection for "special" header fields

There are a few formatting changes in the first commit, sorry.

attempts to guess header table state can be detected by
a peer.
</t>
</section>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I fully understand the limit set by SETTINGS_MAX_CONCURRENT_STREAMS.
For a passive attacker, once this number of requests has been reached, it needs for response to be sent and streams to be closed before having the client make new requests. This slows down the attack but may not help detecting it (its more the total number of requests, the similarity of the requests, and/or the changes in the probed value that would hint that an attack is under way).
For an active attacker, blocking packets, it could sent fake answers to close the requests, allowing more to be done. Here the client would have to detect that something is suspicious, probably by using the strategies described in the Mitigation section below.

I see three possibilities:

  • Removing this paragraph entirely
  • Making clear why there is a limit imposed by SETTINGS_MAX_CONCURRENT_STREAMS
  • List the suspicious behaviour that could help detecting an attack is under way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is fairly tricky, and I'm not sure how to best explain this one. It is important though. One of the key considerations in any attack of this sort is whether the attack can be detected. If it can be detected, then measures can be taken.

In this attack, the attacker allows for the header table to be primed without interference from the attacker, allowing packets to pass normally. Then, when they start guessing, they block further progress, which does not prevent a client from initiating more requests, until they reach SETTINGS_MAX_CONCURRENT_STREAMS, after which the client needs to receive feedback from the server to continue.

I also just realized that this limit is only effective for client-based attacks. An attack by a server is limited only to 2^30 attempts, since PUSH_PROMISE isn't limited in the same way.

Note also that the TCP congestion window doesn't limit the attack, because the attacker can forge TCP acknowledgements.

I will expand on this.

hruellan added a commit that referenced this pull request Jun 13, 2014
HPACK Security Considerations
@hruellan hruellan merged commit 2d7c853 into master Jun 13, 2014
hruellan pushed a commit that referenced this pull request Jun 13, 2014
Merged pull request #517.
Removes SETTINGS_MAX_CONCURRENT_STREAMS paragraph waiting for rewrite.
@martinthomson martinthomson deleted the hpack-security branch July 15, 2014 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants