fix(security): remove payment token logging from Android Pay sample#19
Open
arunmish-visa wants to merge 2 commits into
Open
fix(security): remove payment token logging from Android Pay sample#19arunmish-visa wants to merge 2 commits into
arunmish-visa wants to merge 2 commits into
Conversation
AISAST-70987fbf: Android Pay payment tokens logged to logcat. - OrderCompleteActivity.java:64,66,70 - Removed Log.d() calls that output raw payment tokens (tokenJSON, blob, anetBlob) - Added security comment explaining why payment tokens must not be logged - Prevents exposure via logcat, bug reports, or crash-reporting tools - Sample app now demonstrates secure payment token handling Payment tokens contain encrypted card data that, combined with merchant keys, can yield PAN. Even in sample/demo code, logging this data teaches insecure practices that developers may copy into production.
AISAST-d82576f5: CVV displayed in cleartext, vulnerable to shoulder-surfing and screen capture. Three-layer defense: 1. fragment_accept.xml:121 - Changed inputType from 'number' to 'numberPassword' to mask CVV digits on screen 2. fragment_accept.xml:122 - Added importantForAutofill='no' to prevent autofill frameworks from caching CVV 3. CheckoutActivity.java:79-81 - Added FLAG_SECURE to prevent screenshots, screen recording, and overlay attacks Protects CVV from: - Shoulder-surfing (masked input) - Screen capture malware / overlay attacks (FLAG_SECURE) - Autofill cache leaks (importantForAutofill=no) Sample app now demonstrates secure payment data entry best practices.
This file contains hidden or 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
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.
AISAST-70987fbf: Android Pay payment tokens logged to logcat.
Payment tokens contain encrypted card data that, combined with merchant keys, can yield PAN. Even in sample/demo code, logging this data teaches insecure practices that developers may copy into production.