Open Bug 2015559 Opened 2 months ago Updated 10 days ago

Enable executeScript restriction on extension pages on all channels

Categories

(WebExtensions :: General, task, P2)

task

Tracking

(Not tracked)

People

(Reporter: rpl, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: sec-want, Whiteboard: [addons-jira])

Attachments

(1 file)

As a followup to Bug 2011234, we plan to enable the restriction on all channel as part of the Firefox 152 cycle and let it ride the train (in the meantime the restriction is enabled on Nightly builds by default and a deprecation warning logged in the target extension page when the restriction is being hit).

See Also: → 2016161
Depends on: 1685123
Keywords: sec-want

The bug 2011234 says it's blocking dynamic code execution, but from what I can see, even fixed code execution is blocked.
Is this really intended behavior?

(In reply to juraj.masiar from comment #1)

The bug 2011234 says it's blocking dynamic code execution, but from what I can see, even fixed code execution is blocked.
Is this really intended behavior?

Yes, this is intentional. Access control is based on the target of the execution, and we wanted to consistently apply the change to the all methods without exceptions. And unlike tabs.executeScript, we never documented that scripting.executeScript allows execution in extension documents. Here is the relevant diff of the documentation change:

But why restrict it for the modern scripting namespace at all?
It doesn't allow any dynamic code execution, that was the whole point of MV3.

Being able to use "any" extension API on your own extension tabs is a huge consistency help.
The fact that it wasn't documented is not a good argument as most API doesn't state this, because why should they get a special treatment? It's like updating tabs.setZoom documentation and writing that it works on extensions pages...

I understand the security reasoning in the tabs namespace, but I don't see it helping anyone on already secure scripting namespace.
All I see now is a lot of code I need to change in multiple of my addons :(, and I'm sure it's not just me.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: