Open Bug 2058812 Opened 3 days ago Updated 1 day ago

Services.scriptloader.loadSubScript() fails to load with Error if the file name begins with a non-Latin character.

Categories

(Core :: XPConnect, defect)

Firefox 155
Desktop
Windows 11
defect

Tracking

()

Tracking Status
firefox-esr140 --- unaffected
firefox-esr153 --- unaffected
firefox153 --- unaffected
firefox154 --- unaffected
firefox155 --- affected

People

(Reporter: alice0775, Unassigned)

Details

(Keywords: intl, nightly-community)

Steps to reproduce:
Create a file "あscript.uc.js" in the chrome://userchrome/content/ folder which is specified with chrome.manifest.
Try to load the script using Services.scriptloader.loadSubScript method.

Actual results:
Error opening input stream (invalid filename?): chrome://userchrome/content/%E3%81%82script.uc.js

Interestingly, if a non-Latin character appears anywhere other than the beginning of the filename (i.e., "sあcript.uc.js"), the program runs without any problems.
And in the case of file: protocol (although security.allow_unsafe_subscript_loads must be set to true for the nightly build), both work.

Expected results:
Since these are all valid filenames, they should load correctly.

:tschuster, since you are the author of the regressor, bug 1974213, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(tschuster)

Is this really a regression from that change? Because that really didn't change how we parse URLs. And I would have expected the error to be Trying to load untrusted URI instead. What happens when you set the preference security.allow_unsafe_subscript_loads to true?

Flags: needinfo?(tschuster) → needinfo?(alice0775)

(In reply to Tom Schuster from comment #2)

Is this really a regression from that change? Because that really didn't change how we parse URLs. And I would have expected the error to be Trying to load untrusted URI instead. What happens when you set the preference security.allow_unsafe_subscript_loads to true?

The issue is reproduced even if set security.allow_unsafe_subscript_loads = true.
And also on Firefox91...

In other words, this problem has existed for some time.

Flags: needinfo?(alice0775)
Keywords: regression
No longer regressed by: 1974213

Thank you for checking!

Component: DOM: Core & HTML → XPConnect
Summary: Services.scriptloader.loadSubScript() fails to load with Error if file name start non-latain character. → Services.scriptloader.loadSubScript() fails to load with Error if file name includes non-latain character.
Summary: Services.scriptloader.loadSubScript() fails to load with Error if file name includes non-latain character. → Services.scriptloader.loadSubScript() fails to load with Error if the file name begins with a non-Latin character.
You need to log in before you can comment on or make changes to this bug.