-
Notifications
You must be signed in to change notification settings - Fork 219
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
fix: minimize potential memory leaks of sensitive data on the wallet code #4953
Merged
stringhandler
merged 11 commits into
tari-project:development
from
jorgeantonio21:ja-hide-wallet-sql-outputs
Nov 28, 2022
Merged
fix: minimize potential memory leaks of sensitive data on the wallet code #4953
stringhandler
merged 11 commits into
tari-project:development
from
jorgeantonio21:ja-hide-wallet-sql-outputs
Nov 28, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jorgeantonio21
commented
Nov 24, 2022
@@ -77,7 +78,7 @@ pub fn decrypt_bytes_integral_nonce( | |||
pub fn encrypt_bytes_integral_nonce( | |||
cipher: &XChaCha20Poly1305, | |||
domain: Vec<u8>, | |||
plaintext: Vec<u8>, | |||
plaintext: Hidden<Vec<u8>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another possibility is to pass a plain Vec<u8>
as input and then zeroize plaintext
at the end of the function.
jorgeantonio21
requested review from
SWvheerden,
agubarev,
sdbondi and
stringhandler
November 25, 2022 09:11
stringhandler
approved these changes
Nov 28, 2022
stringhandler
pushed a commit
that referenced
this pull request
Nov 30, 2022
Description --- The goal of this PR is to zeroize sensitive data content across the Tari repo. We pay special attention to kdf key data and other occurrences of sensitive data. For more details, we refer to issue #4846. Moreover, this PR is a companion to #4953 and #4925 Motivation and Context --- Tackle issue #4846. How Has This Been Tested? ---
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Sensitive data is transmitted from wallet and db (ideally encrypted). However, the code is not completely robust against memory leaks. This PR proposes a way to minimize this risk. This implies enforcing encryption immediately whenever we process data for Sqlite interaction (or when fetching it). We further remove any update of sensitive data on SQL outputs, as this would increase the potential risk of memory leaks across the code.
Motivation and Context
Address security vulnerabilities in the wallet code. This PR is related to issue #4846.
How Has This Been Tested?
Refactor some of the existing unit tests.