Closed Bug 1193926 Opened 9 years ago Closed 9 years ago

Don't register chrome for dictionary add-ons

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: mossop, Assigned: mossop)

References

Details

(Keywords: sec-audit, Whiteboard: [adv-main43-])

Attachments

(2 files, 2 obsolete files)

Looks like dictionary add-ons (type 64) inadvertently register chrome.manifest files when used. There is no need for this. I think you could override parts of the browser with this and so there is a way to bypass signing and run unverified code.
Attached patch patch (obsolete) — Splinter Review
This restricts registering chrome to only the types that need it. Technically that is extensions and locale packs. But locale packs aren't signed, so they can inject chrome into the browser :( Sounds like there aren't many (if any?) locale packs that aren't owned by us so maybe we can just require those to be signed. The alternative is to change the manifest parser so locale packs can only define locale chrome, I don't know if that might break things.
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Flags: needinfo?(jorge)
Flags: needinfo?(dveditz)
Well, locale packs should only be able to register locale and full themes (which also need to support chrome.manifest) can only register skin-related stuff. I thought we already had code for that.
(In reply to Robert Kaiser (:kairo@mozilla.com) from comment #2) > Well, locale packs should only be able to register locale and full themes > (which also need to support chrome.manifest) can only register skin-related > stuff. I thought we already had code for that. We do for full themes, I'm not seeing it for locale packs though
I favor restricting language packs to only locale entries in chrome.manifest. I believe we already have that restriction on AMO.
Flags: needinfo?(jorge)
I also thought locales were restricted to registering locale types, and themes only skin types. We should enforce that in the client, not just as an AMO rule. What about "experiments"? Do they need to register chrome? nothing else should be able to. Even restricted to locale chrome resources, though, we have some places where we read raw HTML out of localizations. I'm not a fan but it's a reality that even locale types can inject scripts into the browser. I'd like to see them signed if we could.
Flags: needinfo?(dveditz)
Attached patch patch (obsolete) — Splinter Review
This blocks registering chrome for dictionaries and adds a new chrome location type for locale packs where only locale directives are registered. The boolean flags in the manifest parsing directive list were getting a bit unwieldy so I've instead switched to type flags to split them up and say what is allowed for each chrome location type.
Attachment #8647175 - Attachment is obsolete: true
Attachment #8649012 - Flags: review?(benjamin)
Comment on attachment 8649012 [details] [diff] [review] patch I don't think the NS_LOCALE_TYPE restriction is actually useful. If you register a locale package you can get chrome privileges via the DTD anyway. So can we just not do that part?
Flags: needinfo?(dtownsend)
(In reply to Benjamin Smedberg [:bsmedberg] from comment #7) > Comment on attachment 8649012 [details] [diff] [review] > patch > > I don't think the NS_LOCALE_TYPE restriction is actually useful. If you > register a locale package you can get chrome privileges via the DTD anyway. > So can we just not do that part? How is that? If we don't do that part then we have to make signing a requirement for locale packs.
Flags: needinfo?(dtownsend)
Flags: needinfo?(benjamin)
DTDs are XML. So it's possible to inject arbitrary script into chrome-privilege pages using any entity that is included directly in the page (not in an attribute). For example: <!ENTITY changeSearchSettings.button "<script>Cc[...];</script>Change Search Settings">
Flags: needinfo?(benjamin)
Signing should be a requirement for locale packs, at least until we move away from DTD-based localization completely.
(In reply to Benjamin Smedberg [:bsmedberg] from comment #10) > Signing should be a requirement for locale packs, at least until we move > away from DTD-based localization completely. Ok, spun that out into bug 1197876
Attachment #8649012 - Attachment is obsolete: true
Attachment #8649012 - Flags: review?(benjamin)
Attached patch patchSplinter Review
Removed the unnecessary churn here
Attachment #8651840 - Flags: review?(benjamin)
Attached patch patchSplinter Review
The rest of the patch for posterity
Attachment #8651840 - Flags: review?(benjamin) → review+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Group: core-security → core-security-release
Depends on: 1228359
Whiteboard: [adv-main43-]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: