Closed Bug 1961170 Opened 1 year ago Closed 1 year ago

Drag and dropping an allowed and a blocked file for upload will not upload the allowed file

Categories

(Firefox :: Data Loss Prevention, defect)

Firefox 138
Desktop
Windows
defect

Tracking

()

VERIFIED FIXED
140 Branch
Tracking Status
firefox140 --- verified

People

(Reporter: gstoll, Assigned: gstoll)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(7 files, 2 obsolete files)

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

Found in

  • 138.0a1 (2025-03-17)

Affected versions

  • 138.0a1 (2025-03-17)

Tested platforms

  • Affected platforms: Windows 10x64, Windows 11
  • Unaffected platforms: Ubuntu 24, macOS

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
  • DLP Agent is running: .\content_analysis_sdk_agent.exe --user --toblock=.*\d{3}-?\d{2}-?\d{4}.* --towarn=.*warn.* --delays=10

Steps to reproduce

  1. Drag and drop a blocked and an allowed file to https://codepen.io/gregstoll/full/GRYjjry.

Expected result

  • The allowed file should be uploaded per 1950424#c0

Actual result

  • All files are blocked.

Regression range

Additional notes

  • Attached a screen recording.
  • The issue reproduces as well when clipboard pasting a blocked and allowed file.
Depends on: 1950424
No longer depends on: 1954680

The severity field is not set for this bug.
:handyman, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(davidp99)
Status: NEW → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1954680
Flags: needinfo?(davidp99)
Resolution: --- → DUPLICATE

Sorry, got my bugs confused.

Assignee: nobody → gstoll
Severity: -- → S4
Status: RESOLVED → REOPENED
No longer duplicate of bug: 1954680
Resolution: DUPLICATE → ---
Status: REOPENED → ASSIGNED

The new entry point analyzeBatchContentRequest() (added in a later part)
is going to want this parameter.

This adds a nsIContentAnalysisBatchResult interface which includes the
allowedFiles that the new method returns. On the C++ side I made the
existing ContentAnalysisActionResult class implement this interface
as well, but I'm not married to this; we could make a separate class
instead.

In practice I kind of doubt that a user on Windows could actually drag
some data that has some files and some non-files, but the code should
handle this case correctly. The non-files control whether the overall
result of the nsIContentAnalysisBatchResult is eAllow or eBlock, and
the files that are allowed will get put in allowedFiles.

The new entry point analyzeBatchContentRequest() (added in a later part)
is going to want this parameter.

This adds a nsIContentAnalysisBatchResult interface which includes the
allowedFiles that the new method returns. On the C++ side I made the
existing ContentAnalysisActionResult class implement this interface
as well, but I'm not married to this; we could make a separate class
instead.

In practice I kind of doubt that a user on Windows could actually drag
some data that has some files and some non-files, but the code should
handle this case correctly. The non-files control whether the overall
result of the nsIContentAnalysisBatchResult is eAllow or eBlock, and
the files that are allowed will get put in allowedFiles.

Ideally aAllowedFilePaths would be an array of nsIFile, but unfortunately
we don't seem to be able to pass nsIFile's over IPC, so pass the paths
instead. This should be fine for Windows but may need more testing or
a better solution if/when we support Mac.

Attachment #9486428 - Attachment is obsolete: true
Attachment #9486429 - Attachment is obsolete: true
Pushed by gstoll@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/55ab0d218137 part 1 - add autoAcknowledge to CheckFilesInBatchMode() r=dlp-reviewers,win-reviewers,handyman https://hg.mozilla.org/integration/autoland/rev/3fee4b4f2e97 part 2 - add AnalyzeBatchContentRequest method r=dlp-reviewers,handyman https://hg.mozilla.org/integration/autoland/rev/d65985bc1774 part 3 - make DispatchToDropTargetAndResumeEndDragSession() take allowedFiles r=dlp-reviewers,handyman https://hg.mozilla.org/integration/autoland/rev/65557232a65f part 4 - make DispatchToDropTargetAndResumeEndDragSession() take allowedFilePaths r=dlp-reviewers,handyman https://hg.mozilla.org/integration/autoland/rev/db291af4e23d part 5 - make SendDispatchToDropTargetAndResumeEndDragSession() take allowedFiles r=dlp-reviewers,handyman https://hg.mozilla.org/integration/autoland/rev/d41e3c1fae52 part 6 - update JS drag and drop code to call AnalyzeBatchContentRequest() and pass allowedFiles r=dlp-reviewers,reusable-components-reviewers,handyman,hjones https://hg.mozilla.org/integration/autoland/rev/f284a629b1c1 part 7 - update CA drag and drop tests r=dlp-reviewers,handyman
Flags: qe-verify+

Hello! Verified fixed with Firefox 140.0b1 on Windows 10x64. The ALLOWed file is correctly uploaded via drag and drop when a blocked and an allowed file are uploaded.

Status: RESOLVED → VERIFIED
Has STR: --- → yes
QA Whiteboard: [qa-ver-done-c141/b40]
Flags: qe-verify+
QA Whiteboard: [qa-ver-done-c141/b40] → [qa-ver-done-c141/b140]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: