You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Android] Verify SensitiveContent widget potential frame drops are not visible #164820
We should build a sample app to verify that dropped frames caused by the MethodChannel communication that the SensitiveContent widget uses to communicate with the engine is largely unobservable, and to confirm that this should not be a blocking problem for feature release.
Not sure what the rubric is here, but I built a simple app and recorded some samples to show that we don't observe sensitive content before the screen becomes obscured. I tested with Google Meets. There is some delay because it's screen sharing on Meets; not sure if this is a concern but open to thoughts.
On the left, is the Google Meets screen share. On the right is the device.
Case 1: Navigating to new page with a sensitive SensitiveContent widget.
sc_proof_1.mov
Case 2: Launching an app with a SensitiveContent widget on the first screen
sc_proof_2.mov
Case 3: Clicking a button to switch a SensitiveContent's sensitivity level from not sensitive to sensitive
@reidbaker@justinmc@chunhtai Can you take a look at the videos I recorded above? Proving dropped frames are not visible is required to land #158473, so hoping to get feedback from you all.
I think this should be fine, but I am not the expert of the threading in the engine. Based on the code, the messagechannel will be sent during build phase before the layer tree is sent to the engine. so I think toggling the setting should execute before the new frame is drawn.
@camsim99 this is exactly what I was hoping to see. With that app can I get you to test rotation? That would be the one final case that I would hate for us to miss.
What do we think about the navigation case? I would prefer for it not to block the PR because I assume it's not possible to fix without pursuing JNIgen. Maybe we can write a warning about the race condition with animations (I assume this applies to buttons, navigation)?
I can understand the case for not "releasing this feature" (whatever that means) without it being fixed, though the timeline would have to be extended for this project.
However, landing the PR would make our security strictly better, so that's where I'm coming from.
I like the changes you made with @VisibleForTesting. Can you also include a dart doc comment pointing to this bug and saying the widget is not ready for consumption. Then I am comfortable landing the pr.
We plan to implement it with JNIgen instead of method channels to ensure that the call to obscure the screen is synchronous #160050. It shouldn't impact the API we expose though!
I've seen this sort of problem come up before, but never for a top-level widget/class. For example in the secure paste project, we turned the feature off by default using a parameter to EditableText until it was ready, but we can't exactly do that here. I think this is a good precedent for this situation though.
Left an in detail comment here: #158473 (comment), but new plan is to land #158473 exposing the widget and explain the vulnerability in the SensitiveContent docs for now. Thus, the feature will essentially be shipped in master.
Fixing this issue will accompany #160050. In the meantime, this issue can help track any known SensitiveContent widget vulnerabilities. I will reference this issue in the SensitiveContent docs.
Additional context: making a synchronous call requires 2 things to happen. First we need the opt out thread merging to be removed. Second we need to go though a design review for how dart ui will use jnigen in our code base.
In the meantime page transition animations will prevent leakage and are on by default in most apps and that not landing the feature is strictly worse for protecting users.
Activity
camsim99 commentedon Mar 12, 2025
Not sure what the rubric is here, but I built a simple app and recorded some samples to show that we don't observe sensitive content before the screen becomes obscured. I tested with Google Meets. There is some delay because it's screen sharing on Meets; not sure if this is a concern but open to thoughts.
On the left, is the Google Meets screen share. On the right is the device.
Case 1: Navigating to new page with a sensitive
SensitiveContentwidget.sc_proof_1.mov
Case 2: Launching an app with a
SensitiveContentwidget on the first screensc_proof_2.mov
Case 3: Clicking a button to switch a
SensitiveContent's sensitivity level from not sensitive to sensitivesc_proof_3.mov
camsim99 commentedon Mar 12, 2025
@reidbaker @justinmc @chunhtai Can you take a look at the videos I recorded above? Proving dropped frames are not visible is required to land #158473, so hoping to get feedback from you all.
chunhtai commentedon Mar 12, 2025
I think this should be fine, but I am not the expert of the threading in the engine. Based on the code, the messagechannel will be sent during build phase before the layer tree is sent to the engine. so I think toggling the setting should execute before the new frame is drawn.
reidbaker commentedon Mar 12, 2025
@camsim99 this is exactly what I was hoping to see. With that app can I get you to test rotation? That would be the one final case that I would hate for us to miss.
chunhtai commentedon Mar 12, 2025
oh btw, one more thing to try is to remove page transition duration entirely when pushing new route to see if it still work.
camsim99 commentedon Mar 12, 2025
The requested test cases:
These cases seem to work :)
Rotating device after content has been marked sensitive
sc_proof_4.mov
Background app after content has been marked sensitive, open another app, rotate device, then resume app
sc_proof_5.mov
This breaks it :(
Pushing a new route without page transition duration
(used
PageRouteBuilderwithtransitionDuration: Duration.zeroandreverseTransitionDuration: Duration.zero)sc_proof_6.mov
camsim99 commentedon Mar 12, 2025
What do we think about the navigation case? I would prefer for it not to block the PR because I assume it's not possible to fix without pursuing JNIgen. Maybe we can write a warning about the race condition with animations (I assume this applies to buttons, navigation)?
camsim99 commentedon Mar 12, 2025
I can understand the case for not "releasing this feature" (whatever that means) without it being fixed, though the timeline would have to be extended for this project.
However, landing the PR would make our security strictly better, so that's where I'm coming from.
reidbaker commentedon Mar 13, 2025
Lets ask the framework team for how to feature flag a widget.
reidbaker commentedon Mar 13, 2025
Can you share your code for the page transition example?
9 remaining items
camsim99 commentedon Mar 13, 2025
I assume you're talking about #158473 (comment)?
Or are you saying you also lean towards making the widget @VisibleForTesting if that's an option available to us?
reidbaker commentedon Mar 13, 2025
My comment should have been on the pr. I will put it there.
camsim99 commentedon Mar 13, 2025
Page transition code sample (not the exact one, but made it minimal)
johnmccutchan commentedon Mar 13, 2025
Do we know precisely how we plan on fixing the leaking of information here?
Do we know if that solution will impact the API that we expose?
camsim99 commentedon Mar 13, 2025
We plan to implement it with JNIgen instead of method channels to ensure that the call to obscure the screen is synchronous #160050. It shouldn't impact the API we expose though!
justinmc commentedon Mar 14, 2025
I think we've settled on a good plan here 👍 .
@visibleForTesting.I've seen this sort of problem come up before, but never for a top-level widget/class. For example in the secure paste project, we turned the feature off by default using a parameter to EditableText until it was ready, but we can't exactly do that here. I think this is a good precedent for this situation though.
camsim99 commentedon Apr 16, 2025
Left an in detail comment here: #158473 (comment), but new plan is to land #158473 exposing the widget and explain the vulnerability in the
SensitiveContentdocs for now. Thus, the feature will essentially be shipped in master.Fixing this issue will accompany #160050. In the meantime, this issue can help track any known
SensitiveContentwidget vulnerabilities. I will reference this issue in theSensitiveContentdocs.[Android] Implement setting sensitive content, take 2 (#167815)
camsim99 commentedon May 8, 2025
Dropping priority as this work will need to be re-done when a JNIgen implementation is pursued.
reidbaker commentedon May 8, 2025
Additional context: making a synchronous call requires 2 things to happen. First we need the opt out thread merging to be removed. Second we need to go though a design review for how dart ui will use jnigen in our code base.
In the meantime page transition animations will prevent leakage and are on by default in most apps and that not landing the feature is strictly worse for protecting users.
[Android] Implement setting sensitive content, take 2 (flutter#167815)