Firefox DLP scans the pasted content multiple times when copied from Google/OneDrive Documents
Categories
(Firefox :: Data Loss Prevention, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox134 | --- | verified |
People
(Reporter: bhidecuti, Assigned: gstoll)
References
(Blocks 4 open bugs, Regressed 7 open bugs)
Details
Crash Data
Attachments
(22 files)
3.09 MB,
video/mp4
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
3.73 MB,
video/x-matroska
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
gstoll
:
approval-mozilla-esr128?
|
Details | Review |
Found in
- 131.0a1 (2024-08-27)
Affected versions
- 131.0a1
Preconditions
- Download the DLP test assets from https://drive.google.com/file/d/1yjqVRuxdKV3WnO7D2wzMgDXBuYBxUgVw/view
- Create a distribution folder inside the Firefox folder and paste the policies-1.json to it and then rename it to policies.json
- Run the DLP agent in CMD using: .\content_analysis_sdk_agent.exe --user --toblock=.\d{3}-?\d{2}-?\d{4}. --towarn=.warn. --delays=10
Tested platforms
- Affected platforms: Windows 10/11
- Unaffected platforms: Ubuntu, macOS
Steps to reproduce
- Go to https://drive.google.com/drive/home and sign in
- Open up a Google Doc and type “ok text” into it and copy it (or any random text)
- Open a second Google Doc or navigate to a random website (e.g. Wikipedia)
- Paste the copied text from step 2
- Observe the behavior
Expected result
- The pasted content is scanned only once
Actual result
- The pasted content is scanned 2-3 times consecutively on website or even 4-5 times on Google Docs
Regression range
- Potentially regressed by 1912384, but I am not 100% sure, since I cannot determine the regression range using Mozregression
Additional notes
- See the attached video
- Also reproducing if pasting a selected text into Google Docs / OndeDrive docs from a random website (the content is scanned twice)
- Also reproducing for the blocked DLP data (e.g. ‘123456789’) / warning DLP data (‘warning text’) - the content is scanned multiple times
- Not reproducing if pasting from Notepad
Assignee | ||
Comment 1•3 months ago
|
||
The problem is that when copying from Google Docs it stores the text in at least three different formats - an custom one, text/html, and text/plain, so if another website is trying to get data from it in multiple formats this will require multiple DLP checks.
Some ideas we had about this:
- perhaps when someone gets one format from the clipboard Firefox could get all the formats and pass them all to DLP, then cache the results for future calls. This has the advantage of only popping up one dialog, but it means we might be doing extra unneeded work, and it won't make things any faster even in the case where the cache is used.
We're probably going to have to live with this for now.
Assignee | ||
Comment 2•3 months ago
|
||
Implementing bug 1915653 would at least reduce this to around 3 calls, as opposed to the 4 or 5 there are now.
Updated•2 months ago
|
Assignee | ||
Comment 6•2 months ago
|
||
I'm going to take another look at this and try to scan all the clipboard contents at once instead of one at a time on demand.
Assignee | ||
Comment 7•2 months ago
|
||
This is used in later patches to determine whether we have run
content analysis on the current clipboard contents.
Assignee | ||
Comment 8•2 months ago
|
||
- Make CheckClipboardContentAnalysis() analyze all flavors of data in the
passed-in transferable, and wrap all the individual requests in an
AggregatedContentAnalysisResultCallback that fires when all the
individual requests are done (or early if there's an error or something
is blocked) - If the full clipboard contents are analyzed, cache the result so future
calls to analyze individual entries can get returned immediately.
Assignee | ||
Comment 9•2 months ago
|
||
Add an entry point to ClipboardContentAnalysisParent to analyze all
the clipboard contents.
Assignee | ||
Comment 10•2 months ago
|
||
Assignee | ||
Comment 11•2 months ago
|
||
This will be used in future patches to identify which dialog to close
when a content analysis request is done.
Assignee | ||
Comment 12•2 months ago
|
||
This uses the already-existing ability of the TabDialogManager to show
a dialog immediately after the previous one closes. So this code doesn't
need to keep track of what dialog to show next - it just displays them
all (and closes them appropriately), and the TabDialogManager will show
them one at a time.
Assignee | ||
Comment 13•2 months ago
|
||
The cache introduced in a previous patch caches all clipboard contents
in a more efficient way, so we no longer need the band-aid cache that
only cached one MIME type at a time.
Assignee | ||
Comment 14•2 months ago
|
||
If content analysis is returning a cached BLOCK result for the full clipboard,
we should show the BLOCK dialog, so create a fake request and response
and notify based on those.
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Updated•2 months ago
|
Comment 18•1 month ago
|
||
Copying crash signatures from duplicate bugs.
Updated•1 month ago
|
Assignee | ||
Comment 19•1 month ago
|
||
The changes in the rest of this stack change the order that we do CA
in, and also eliminate some redundant calls, so fix up the tests to
reflect this.
Updated•1 month ago
|
Comment 20•25 days ago
|
||
Comment 21•24 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a8b2b1f62ae6
https://hg.mozilla.org/mozilla-central/rev/2b900eb520ce
https://hg.mozilla.org/mozilla-central/rev/a20adf8d4516
https://hg.mozilla.org/mozilla-central/rev/c5279472391f
https://hg.mozilla.org/mozilla-central/rev/fba6942240ea
https://hg.mozilla.org/mozilla-central/rev/1cf3847d73a7
https://hg.mozilla.org/mozilla-central/rev/aa0e2ce8cf21
https://hg.mozilla.org/mozilla-central/rev/4fcb7eea243f
https://hg.mozilla.org/mozilla-central/rev/574d567bbbf1
Comment 23•23 days ago
•
|
||
Backed out 9 changesets (Bug 1915351) for causing multiple regressions.
Comment 24•23 days ago
|
||
Hello! We looked over this today but it seems that the following issues are still reproducing with this patch (screen-recording attached). Leaving some notes here for future reference:
- Pasting from gdoc to another gdoc will scan the content two times (including showing the warning or blocked dialog for two times)
- Pasting from another webpage inside gdoc will scan the content two times (including showing the warning or blocked dialog for two times)
- Sometimes pasting from Gdoc to Gdoc will have an increased time and the content is scanned multiple times, showing the warning dialog if the string is
test
. (access this link and copy-paste the secondtest
string inside gdoc - see the first issue in the screen recording) - Additionally, now the content is also scanned twice when pasting it inside Gdoc from an external app (e.g. Notepad). This was not the case before the fix.
We also filled bug 1927129 and bug 1927131 with this patch landed.
Comment 25•22 days ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/19214f0d561f
Updated•20 days ago
|
Updated•20 days ago
|
Updated•20 days ago
|
Updated•20 days ago
|
Updated•20 days ago
|
Updated•20 days ago
|
Updated•20 days ago
|
Updated•20 days ago
|
Assignee | ||
Comment 26•20 days ago
|
||
This part of the test fails often on try. I'm not sure what's going on
(sometimes a file gets put on the clipboard as well), but the point of
this test is to test content analysis, not Copy Image Contents, so
just set the clipboard contents directly.
I get passing test-verify builds with this change.
Assignee | ||
Updated•20 days ago
|
Comment 27•20 days ago
|
||
Comment 28•20 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/86f4e754ee72
https://hg.mozilla.org/mozilla-central/rev/a33c055119dc
https://hg.mozilla.org/mozilla-central/rev/7b3dcb65cb10
https://hg.mozilla.org/mozilla-central/rev/b145e536fe64
https://hg.mozilla.org/mozilla-central/rev/e729a9c40766
https://hg.mozilla.org/mozilla-central/rev/0650e8d79222
https://hg.mozilla.org/mozilla-central/rev/7f1779828088
https://hg.mozilla.org/mozilla-central/rev/385fac4e9fc2
https://hg.mozilla.org/mozilla-central/rev/800572858d69
https://hg.mozilla.org/mozilla-central/rev/d6db8b2ff6eb
Reporter | ||
Updated•19 days ago
|
Reporter | ||
Comment 29•19 days ago
|
||
Verified as fixed using Firefox Nightly 134.0a1 (2024-10-29), on Windows 10/11. The content is no longer scanned 4-5 times on Google Docs.
However, the content is still scanned twice when pasting to Gdoc/OneDrive doc from another Gdoc/webpage/external app.
This will be addressed in bug 1927776.
Assignee | ||
Comment 30•4 days ago
|
||
This is used in later patches to determine whether we have run
content analysis on the current clipboard contents.
Original Revision: https://phabricator.services.mozilla.com/D223410
Updated•4 days ago
|
Assignee | ||
Comment 31•4 days ago
|
||
- Make CheckClipboardContentAnalysis() analyze all flavors of data in the
passed-in transferable, and wrap all the individual requests in an
AggregatedClipboardContentAnalysisResultCallback that fires when all the
individual requests are done (or early if there's an error or something
is blocked) - If the full clipboard contents are analyzed, cache the result so future
calls to analyze individual entries can get returned immediately.
Original Revision: https://phabricator.services.mozilla.com/D223411
Updated•4 days ago
|
Assignee | ||
Comment 32•4 days ago
|
||
Add an entry point to ClipboardContentAnalysisParent to get all the
data on the clipboard, which also analyzes all the clipboard contents.
Original Revision: https://phabricator.services.mozilla.com/D223412
Updated•4 days ago
|
Assignee | ||
Comment 33•4 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D223413
Updated•4 days ago
|
Assignee | ||
Comment 34•4 days ago
|
||
This will be used in future patches to identify which dialog to close
when a content analysis request is done.
Original Revision: https://phabricator.services.mozilla.com/D223414
Updated•4 days ago
|
Assignee | ||
Comment 35•4 days ago
|
||
This uses the already-existing ability of the TabDialogManager to show
a dialog immediately after the previous one closes. So this code doesn't
need to keep track of what dialog to show next - it just displays them
all (and closes them appropriately), and the TabDialogManager will show
them one at a time.
Original Revision: https://phabricator.services.mozilla.com/D223415
Updated•4 days ago
|
Assignee | ||
Comment 36•4 days ago
|
||
The cache introduced in a previous patch caches all clipboard contents
in a more efficient way, so we no longer need the band-aid cache that
only cached one MIME type at a time.
Original Revision: https://phabricator.services.mozilla.com/D223416
Updated•4 days ago
|
Assignee | ||
Comment 37•4 days ago
|
||
If content analysis is returning a cached BLOCK result for the full clipboard,
we should show the BLOCK dialog, so create a fake request and response
and notify based on those.
Original Revision: https://phabricator.services.mozilla.com/D223605
Updated•4 days ago
|
Assignee | ||
Comment 38•4 days ago
|
||
The changes in the rest of this stack change the order that we do CA
in, and also eliminate some redundant calls, so fix up the tests to
reflect this.
Original Revision: https://phabricator.services.mozilla.com/D224844
Updated•4 days ago
|
Assignee | ||
Comment 39•4 days ago
|
||
This part of the test fails often on try. I'm not sure what's going on
(sometimes a file gets put on the clipboard as well), but the point of
this test is to test content analysis, not Copy Image Contents, so
just set the clipboard contents directly.
I get passing test-verify builds with this change.
Original Revision: https://phabricator.services.mozilla.com/D227037
Updated•4 days ago
|
Comment 40•4 days ago
|
||
esr128 Uplift Approval Request
- User impact if declined: DLP users will experience multiple annoying scans when pasting into Google Docs, etc.
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: n/a
- Risk associated with taking this patch: medium
- Explanation of risk level: changes a little bit of clipboard behavior
- String changes made/needed: no
- Is Android affected?: no
Description
•