Closed Bug 1873474 Opened 1 year ago Closed 1 year ago

Replace or remove NS_CheckContentProcessPolicy call in ImageDocument

Categories

(Core :: DOM: Security, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: tschuster, Assigned: tschuster)

References

(Blocks 1 open bug)

Details

(Whiteboard: [domsecurity-backlog1])

Attachments

(1 file)

ImageListener::OnStartRequest is one of the only two callers of NS_CheckContentProcessPolicy. It was original added in bug 200433, to make content blocking of images inside an iframe. (This is required because in that case the image is loaded as a content type of TYPE_INTERNAL_IFRAME not TYPE_INTERNAL_IMAGE)

We removed most of the code for nsContentBlocker in bug 1357107, but did introduce ImageBlocker. However that regressed image blocking inside iframes again, because ImageBlocker::ShouldProcess doesn't actually do anything.

I am not sure if we can just replace that call with NS_CheckContentProcessPolicy with NS_CheckContentLoadPolicy, because some implementation like CSPService::ShouldProcess just do nothing for images currently, in contrast to ShouldLoad. The other solution would be to just not bother with blocking images here at all.

No longer blocks: 380556
Blocks: 1447256
Severity: -- → N/A
Priority: -- → P3
Whiteboard: [domsecurity-backlog1]
Assignee: nobody → tschuster
Attachment #9371980 - Attachment description: WIP: Bug 1873474 - Use ImageBlocker directly instead of nsIContentPolicy::ShouldProcess in ImageDocument. → Bug 1873474 - Use ImageBlocker directly instead of nsIContentPolicy::ShouldProcess in ImageDocument. r?smaug
Status: NEW → ASSIGNED
Pushed by tschuster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b6f095262402 Use ImageBlocker directly instead of nsIContentPolicy::ShouldProcess in ImageDocument. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: