-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Deflate decompression hangs on trailing garbage #176
Comments
Lukasa
added a commit
to Lukasa/swift-nio-extras
that referenced
this issue
Sep 15, 2022
Motivation Currently we don't confirm that the decompression has completed successfully. This means that we can incorrectly spin forever attempting to decompress past the end of a message, and that we can fail to notice that a message is truncated. Neither of these is good. Modifications Propagate the message zlib gives us as to whether or not decompression is done, and keep track of it. Add some tests written by @vojtarylko to validate the behaviour. Result Correctly police the bounds of the messages. Resolves apple#175 and apple#176.
Lukasa
added a commit
to Lukasa/swift-nio-extras
that referenced
this issue
Sep 15, 2022
Motivation Currently we don't confirm that the decompression has completed successfully. This means that we can incorrectly spin forever attempting to decompress past the end of a message, and that we can fail to notice that a message is truncated. Neither of these is good. Modifications Propagate the message zlib gives us as to whether or not decompression is done, and keep track of it. Add some tests written by @vojtarylko to validate the behaviour. Result Correctly police the bounds of the messages. Resolves apple#175 and apple#176.
Great catch, resolved by #177. I'll try to get a fix out ASAP. I'll also retroactively apply for a CVE and publish a notification, but as this was publicly reported I'd like to get the release out first. Thanks so much for reporting! |
Lukasa
added a commit
that referenced
this issue
Sep 16, 2022
Motivation Currently we don't confirm that the decompression has completed successfully. This means that we can incorrectly spin forever attempting to decompress past the end of a message, and that we can fail to notice that a message is truncated. Neither of these is good. Modifications Propagate the message zlib gives us as to whether or not decompression is done, and keep track of it. Add some tests written by @vojtarylko to validate the behaviour. Result Correctly police the bounds of the messages. Resolves #175 and #176.
Lukasa
added a commit
to Lukasa/swift-nio-extras
that referenced
this issue
Sep 16, 2022
Motivation Currently we don't confirm that the decompression has completed successfully. This means that we can incorrectly spin forever attempting to decompress past the end of a message, and that we can fail to notice that a message is truncated. Neither of these is good. Modifications Propagate the message zlib gives us as to whether or not decompression is done, and keep track of it. Add some tests written by @vojtarylko to validate the behaviour. Result Correctly police the bounds of the messages. Resolves apple#175 and apple#176. (cherry picked from commit 6c84d24)
Lukasa
added a commit
to Lukasa/swift-nio-extras
that referenced
this issue
Sep 16, 2022
Motivation Currently we don't confirm that the decompression has completed successfully. This means that we can incorrectly spin forever attempting to decompress past the end of a message, and that we can fail to notice that a message is truncated. Neither of these is good. Modifications Propagate the message zlib gives us as to whether or not decompression is done, and keep track of it. Add some tests written by @vojtarylko to validate the behaviour. Result Correctly police the bounds of the messages. Resolves apple#175 and apple#176. (cherry picked from commit 6c84d24)
Fix is out. |
@Lukasa Thanks for fast fix! Was CVE published already? |
Not yet, I’ll update this issue when it is. |
We've assigned this CVE-2022-3252. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I tried to extend
HTTPRequestDecompressorTest
with this test case:and when tried to run it, the test hangs forever.
If confirmed, this is security issue which can cause DoS.
The text was updated successfully, but these errors were encountered: