Closed Bug 366868 Opened 19 years ago Closed 19 years ago

Extension name should be escaped in JS calls

Categories

(addons.mozilla.org Graveyard :: Public Pages, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ma1, Assigned: fligtar)

References

()

Details

Attachments

(1 file)

Extensions with a single quote in their name break JavaScript in extension detail page. While names are HTML escaped (correct), they need also to be escaped for proper usage as JS string constants, e.g. in http://lxr.mozilla.org/mozilla/source/webtools/addons/public/tpl/addon.tpl#39 Notice that, generally speaking, this kind of bugs can theoretically be exploited for XSS attacks. While in this very case this would need a mad reviewer approving an extension with a crazy name, scanning the templates for other instances of this pattern may be advisable (hence the security flag).
Attached patch escape patchSplinter Review
This escapes the name in JavaScript everywhere I can think of: addon.tpl, index.tpl, and recommended.tpl. The names aren't used in the dictionary JavaScript. In addition to the slight security problem, this bug also makes the download counter not work for extensions with quotes in their name, such as the one in this bug's URL.
Assignee: nobody → fligtar
Status: NEW → ASSIGNED
Attachment #251620 - Flags: first-review?(morgamic)
Component: Add-ons → Public Pages
QA Contact: add-ons → web-ui
Attachment #251620 - Flags: first-review?(morgamic) → first-review+
Checked in and tagged for staging/production.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
If someone could remove webtools-security for me, it would pretty much be the best thing ever.
Group: update-security
Status: RESOLVED → VERIFIED
Done.
Group: webtools-security
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: