MdeModulePkg : Clear keyboard queue buffer after reading #10964
+9
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When entering a password, the password keystrokes are stored in a circular queue. This queue is not cleared after password entry, making it possible to snoop some or all of the password characters later by direct examination of the memory which was used as the circular queue, leading to possible information disclosure or escalation of privilege.
To prevent exposure of the password string, clear the queue buffer by filling it with zeros after reading.
BZ4760
How This Was Tested
Modified HelloWorld UEFI shell application to peek the last user input keystroke data from keyboard queue buffer via the EFI_SIMPLE_TEXT_INPUT_PROTOCOL pointer. Ensure that the keystroke data in the keyboard queue buffer is cleared.
TestCode
Integration Instructions
N/A