Open Bug 1961170 Opened 25 days ago Updated 3 days 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

()

ASSIGNED

People

(Reporter: gstoll, Assigned: gstoll)

References

(Blocks 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: 10 days 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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: