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

aes-gcm: avoid exposing plaintext on tag verification failure #551

Merged

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Sep 21, 2023

In #409, for whatever reason I moved the application of the keystream from after the tag check to before. This means the keystream is applied unilaterally, instead of only when tag verification is successful.

Sadly, there was a TODO to test for this. A test has been added to ensure the buffer is unmodified on tag verification failure. It was red/green tested to ensure it caught the previous bug, and that the fix corrects it.

This is being tracked as GHSA-423w-p2w9-r7vq.

In #409, for whatever reason I moved the application of the keystream
from after the tag check to before. This means the keystream is applied
unilaterally, instead of only when tag verification is successful.

Sadly, there was a TODO to test for this. A test has been added to
ensure the buffer is unmodified on tag verification failure. It was
red/green tested to ensure it caught the previous bug, and that the fix
corrects it.

This is being tracked as GHSA-423w-p2w9-r7vq (currently embargoed).
@tarcieri tarcieri added the security Security-critical issues label Sep 21, 2023
@tarcieri tarcieri merged commit b587b27 into master Sep 21, 2023
12 checks passed
@tarcieri tarcieri deleted the aes-gcm/only-apply-keystream-after-tag-verification branch September 21, 2023 22:20
@tarcieri tarcieri mentioned this pull request Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Security-critical issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants