Repository navigation
fix: mask maskView views and secure fields in bug report screenshots and replays - #60
Open
boehlerlukas wants to merge 1 commit into
Open
boehlerlukas wants to merge 1 commit into
boehlerlukas wants to merge 1 commit into
Conversation
…and replays Gleap.maskView (and the automatic secure / one-time-code / card field masks) only applied to the screenshots and recordings of capture requests. Bug report screenshots, silent crash report screenshots and app replay frames all come from GleapScreenCaptureHelper.captureScreen, which drew the key window unmasked. captureScreen now blacks out the same targets through the capture renderer (GleapCaptureRenderer fillMasksInWindow:), falling back to a black window when the masks cannot be placed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What this fixes
Help-center audit finding 26 (high, privacy):
Gleap.maskViewdid not mask bug report screenshots or app replays.maskView(and the automatic masks for secure, one-time-code and card text fields) only applied to capture requests:GleapCaptureManager→GleapCaptureRenderer. Three other paths take their pictures throughGleapScreenCaptureHelper.captureScreen, which drew the key window with no masks:GleapScreenshotManager.m:52)GleapReplayHelper.m:112)sendSilentCrashReport(GleapCore.m:676)So a view the app had masked, and even a password field, showed in plain view in every bug report screenshot and replay.
Fix:
captureScreennow blacks out the same targets after it draws the window. Both drawing paths are covered: the primarydrawViewHierarchyInRect/ Flutter path and therenderInContextfallback. It goes through a newGleapCaptureRenderer fillMasksInWindow:maskedViews:context:, which reuses the renderer's own target walk (maskTargetsInWindow:, with secure, OTP and card fields), its presentation-layer rects (so views mid-animation are covered) andfillMasksOfViews:. If the masks cannot be placed, the whole window is blacked out, as capture frames already do. ThemaskView:header doc now says where it applies.Verified
swift buildcan't build this package on macOS (UIKit), onmaintoo. I usedxcodebuild test -scheme Gleap -destination 'platform=iOS Simulator,name=iPhone 17 Pro'(Xcode 27.1) instead: TEST SUCCEEDED, 132 tests, 0 failures (131 before plus the new one).GleapCaptureTests.testBugReportScreenshotsAndReplayFramesAreMasked. It renders a window throughGleapScreenCaptureHelper performPrimaryCaptureForWindow:withSize:and checks pixels: aGleap.maskViewview and a secure text field come out black, while an unmasked view and the background stay visible. I checked that it fails onmain(both mask assertions) and passes with the fix. This is privacy (sanitising) code, so it gets a test per the workspace rule.Notes
Gleap.maskViewand the automatic secure, one-time-code and card field masks now also apply to bug report screenshots, app replays and silent crash report screenshots."Not fixed (needs decision / out of scope)
maskViewAPI. Their own widgets can't be found as native views anyway; they would need a wrapper API (mask a rect or a widget key). That is a product decision.NONE, which iOS already treats as "none". No iOS change is needed.🤖 Generated with Claude Code