feature: add KB entry for missing FLAG_SECURE screen-capture protection#335
Merged
Conversation
Add a new low-severity Android KB entry APK_MISSING_FLAG_SECURE capturing the generic vulnerability class where an Activity window that displays sensitive data (e.g. a lock-screen / incoming-call PHI window) never sets the per-Window FLAG_SECURE flag, leaving its content capturable by screenshots, screen recording or MediaProjection on every build variant, including the non-debuggable production build. Refs os-35483
3asm
approved these changes
Jul 22, 2026
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.
Summary
Adds a new low-severity Android KB entry
APK_MISSING_FLAG_SECUREthat defines the generic vulnerability class in which anActivitywindow that displays sensitive data never sets the per-WindowFLAG_SECUREflag, so its content is capturable by screenshots, screen recording orMediaProjectionon every build variant — including the non-debuggable production release build.This is the canonical rule definition that detection agents (static and dynamic) report against. It is generic: it applies to any sensitive-data
Activitywindow (most commonly a separate lock-screen / incoming-call PHI window) that omitswindow.setFlags(FLAG_SECURE, FLAG_SECURE)on any code path, and covers the related manifestation of gating the flag behindif (!BuildConfig.DEBUG).Why a KB entry
FLAG_SECUREis a per-Windowflag — a window that does not set it is fully capturable regardless of any other protected window in the app, and the flag cannot be inherited because eachActivityextends a framework class directly. There was no existing KB entry for the missingFLAG_SECUREcase (the existingAPK_SCREENSHOT_DISABLEDentry is the opposite, informational finding reported when screenshots are blocked). This entry closes that gap.Changes
MOBILE_CLIENT/ANDROID/_LOW/APK_MISSING_FLAG_SECURE/meta.json— title,lowrisk rating, short description, references (AndroidFLAG_SECURE/Window.setFlags/setShowWhenLocked, manifestactivityelement,MediaProjection, CWE-200, OWASP MASVS-STORAGE-2, OWASP MASTG-BEST-0016) and compliance categories (OWASP MASVS L2 / MASVS v2, OWASP Mobile Top 10 M6, HIPAA, GDPR, SOC2).description.md— technical detail: per-Window semantics, no inheritance, external capture vectors, the lock-screen/exported-Activitymanifestation, and theBuildConfig.DEBUGguard anti-pattern.recommendation.md— immediate mitigation (unconditionalFLAG_SECUREinonCreatebeforesetContent), permanent fix (sharedSecureComponentActivitybase class), and a regression-prevention static check.context.md— real-world framing, why it happens, impact (PHI/PII exposure, no attach required on production) and business impact.Verification
python -m pytest tests/kb_test.py(excluding the live-URL test) — 23 passed.< 404.ruff format --check .andruff check .pass.Refs os-35483