Ok Google! bypass ‘flag_secure’
Google Assistant on Android 9 could capture screenshots of apps that had set the FLAG_SECURE window flag, which is meant to prevent screen capture. An attacker with physical access to the device could use Google Assistant's screenshot feature to bypass this protection and capture sensitive content.
Published on pankajupadhyay.in
FLAGSECURE is a window level flag in Android ecosystem that allows mobile apps to safeguard their content from a screenshot capture. Application needs to enable it by specifying the WindowManager.LayoutParams#FLAGSECURE for the windows/screens, it doesn’t want to be recorded.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely Google Assistant's screenshot feature did not properly respect the FLAG_SECURE flag when capturing the screen.
Impact
An attacker with physical access to the device could use Google Assistant to capture screenshots of sensitive content that apps intended to protect with FLAG_SECURE.
What the attacker needed
Physical access to the device; Google Assistant enabled; Screenshots enabled in Google Search settings; Use Screen Context enabled
How it was found
- Install the Google Search app and enable Assistant.
- In Google Search settings, enable screenshots under 'General' and enable 'Use Screen Context' under 'Google Assistant', 'Phone'.
- Open Chrome in incognito mode and try to take a screenshot with Power + Volume Down; note that it fails.
- Hold the home button and say 'take screenshot' or 'share screenshot'; Google Assistant takes a screenshot despite FLAG_SECURE.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Android apps can set a flag called FLAG_SECURE to stop other apps from taking screenshots of their windows. The report found that Google Assistant ignored this flag and could still take screenshots. This means someone using Google Assistant could capture private information from apps that thought they were protected.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.