Content scripts can run in view-source: with null principal
Categories
(WebExtensions :: General, defect, P1)
Tracking
(firefox-esr115 unaffected, firefox126 unaffected, firefox127 unaffected, firefox128 fixed)
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox126 | --- | unaffected |
firefox127 | --- | unaffected |
firefox128 | --- | fixed |
People
(Reporter: robwu, Assigned: robwu)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [addons-jira])
Attachments
(2 files)
In bug 1475831, we enabled extensions to run content scripts on null principals if the extension is allowed to access its precursor.
One unintended side effect is that it also enables extensions to run content scripts in view-source:
URLs of documents that have CSP sandbox set without allow-same-origin
. We should ignore null principals if the documents they're associated with has the view-source:
-scheme. Test case can be found in bug 1896824
The same logical flaw also exists in the devtools.inspectedWindow.eval
implementation, at https://searchfox.org/mozilla-central/rev/e65d93ace2a618b58bf1497c5be8918404f6dbbe/devtools/server/actors/addon/webextension-inspected-window.js#113-114
When I run the test case from bug 1865689, it blocks access to view-source:https://example.com/
as expected, but not view-source:https://raw.githubusercontent.com/Robbendebiene/Gesturefy/master/crowdin.yml
Updated•6 months ago
|
Comment 1•6 months ago
|
||
Set release status flags based on info from the regressing bug 1475831
It would be really handy, being able to run userscripts on view-source:
? E.g. I have a userscript which highlights all instances of a string in a certain colour, and other strings in other colours ad libitum.
Assignee | ||
Comment 3•5 months ago
|
||
Assignee | ||
Comment 4•5 months ago
|
||
Assignee | ||
Comment 5•5 months ago
|
||
(In reply to swleefers from comment #2)
It would be really handy, being able to run userscripts on
view-source:
? E.g. I have a userscript which highlights all instances of a string in a certain colour, and other strings in other colours ad libitum.
Please file a new bug (enhancement / feature request) request for that. The current partial support for view-source:
was accidental. If there are valid use cases for code execution at view-source, then we could consider that separately.
https://hg.mozilla.org/mozilla-central/rev/c86294ddb06e
https://hg.mozilla.org/mozilla-central/rev/38bda664f3cb
https://hg.mozilla.org/mozilla-central/rev/a2e89e6ece0f
Description
•