| Commit-Queue | +1 |
Hi Qihui, could you please review this CL? Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Some high level comments:
Security safety concern: Since GetUnmaskedCardCache() is a static base::NoDestructor, the unmasked card data (including full card numbers and potentially CVCs) stays in memory until the app process is killed. If the user switches away from the app and leaves it in the background, sensitive data remains in RAM.
Other than that, base::NoDestructor is thread-safe for initialization, but std::map is not thread-safe for r/w. If onPersonalDataChanged (which clears the map) fires on the main thread while a background fetch or UI lookup is happening, it might crash.
Lastly, we don't need to cache all card types, for those local or masked server card, it does not need to cache as it's doing an authentication on month/year fetching.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Some high level comments:
Security safety concern: Since GetUnmaskedCardCache() is a static base::NoDestructor, the unmasked card data (including full card numbers and potentially CVCs) stays in memory until the app process is killed. If the user switches away from the app and leaves it in the background, sensitive data remains in RAM.
Other than that, base::NoDestructor is thread-safe for initialization, but std::map is not thread-safe for r/w. If onPersonalDataChanged (which clears the map) fires on the main thread while a background fetch or UI lookup is happening, it might crash.
Lastly, we don't need to cache all card types, for those local or masked server card, it does not need to cache as it's doing an authentication on month/year fetching.
1. Security: Added an observer for UIApplicationDidEnterBackgroundNotification to clear the cache immediately when the app enters the background.
2. Thread Safety: Introduced base::Lock to ensure thread-safe access to the map.
3. Cache Scope: Updated the logic to only cache kVirtualCard types
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |