Closed
Bug 180748
Opened 22 years ago
Closed 21 years ago
There is no security check on XUL script src, are there others?
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bsharma, Assigned: security-bugs)
Details
(Keywords: fixed1.4)
Attachments
(1 file)
1.57 KB,
patch
|
hjtoi-bugzilla
:
review+
brendan
:
superreview+
blizzard
:
approval1.4+
|
Details | Diff | Splinter Review |
This bug is reported as the issue in the module review and jrgm asked me to make
a bug out of it.
Assignee | ||
Comment 1•22 years ago
|
||
I'm taking this one; part of the CheckLoadURI overhaul.
Assignee: jaggernaut → mstoltz
Assignee | ||
Comment 2•22 years ago
|
||
I want to add a call to CheckLoadURI for <script src="..."/> tags in XUL, to
prevent XUL pages loaded from http:// from using JS files from file:// (they
will still be able to use script files from chrome). I'm not sure where to put
the call - my guess is nsXULContentSink, but I'm not sure where the best spot
is; I don't want to mess up the Fastload stuff. Can you offer any advice?
Flags: blocking1.4?
I don't think the sink is enough, since you can create a script element
dynamically. It should go into the script element or the script loader, I think.
Assignee | ||
Comment 4•21 years ago
|
||
from Brendan:
There's nothing to worry about with FastLoad. Just check in
nsXULContentSink::OpenScript, near the NS_NewURI call. That call's failure case
is handled by a delete script; return rv block.
Assignee | ||
Comment 5•21 years ago
|
||
Assignee | ||
Comment 6•21 years ago
|
||
Comment on attachment 124395 [details] [diff] [review]
Patch - add CheckLoadURI call to XUL script tag parsing
Seeking reviews.
Attachment #124395 -
Flags: superreview?(brendan)
Attachment #124395 -
Flags: review?(heikki)
Comment on attachment 124395 [details] [diff] [review]
Patch - add CheckLoadURI call to XUL script tag parsing
r=heikki if you add a comment saying that if/when XUL scripts can be
dynamically created and they can load external source, then the security check
should move there (currently our understanding is that they cannot be created
dynamically or at least they won't work if they are created)
Attachment #124395 -
Flags: review?(heikki) → review+
Comment 8•21 years ago
|
||
Comment on attachment 124395 [details] [diff] [review]
Patch - add CheckLoadURI call to XUL script tag parsing
Looks ok to me -- where is the code that prevents a script from making a script
node and setting its src attribute?
/be
Attachment #124395 -
Flags: superreview?(brendan) → superreview+
I don't think there is any code to trigger loading the src when the script
element is created dynamically. I tried some tests to create the script
dynamically and set the src attribute, but the external script was never executed.
Also, in nsXULElement.cpp line 5216 there seems to be code that prevents cached
XUL (fastload?) from loading non-chrome JS.
Mitch, could you also check out nsXULDocument::LoadScript() and make sure that
it cannot veto over the sink? Just in case...
Updated•21 years ago
|
Attachment #124395 -
Flags: approval1.4?
Comment 10•21 years ago
|
||
> Also, in nsXULElement.cpp line 5216 there seems to be code that prevents cached
> XUL (fastload?) from loading non-chrome JS.
No, that check is deciding whether to cache the compiled script in memory. It
has nothing to do with FastLoad per se, although related XUL content code
requires a chrome script to be cached after being compiled, so that it will
never be reloaded from disk (and therefore mux'd to the FastLoad file twice).
/be
Assignee | ||
Comment 11•21 years ago
|
||
I can't find any code path that bypasses the sink, so I think we're OK. Iv'e
checked this in on the trunk, waiting for 1.4 branch approval.
Status: NEW → ASSIGNED
Comment 12•21 years ago
|
||
Comment on attachment 124395 [details] [diff] [review]
Patch - add CheckLoadURI call to XUL script tag parsing
a=blizzard for 1.4
Attachment #124395 -
Flags: approval1.4? → approval1.4+
Comment 13•21 years ago
|
||
a=adt to landon the 1.4 branch.
Assignee | ||
Comment 14•21 years ago
|
||
Checked in on trunk.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 15•21 years ago
|
||
And on the branch.
Comment 18•20 years ago
|
||
Bugs published on the Known-vulnerabilities page long ago, removing confidential
flag.
Group: security
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•