Closed Bug 305374 Opened 19 years ago Closed 19 years ago

AppleScript "Get URL" command can make Firefox open chrome:// URLs

Categories

(Firefox :: Shell Integration, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: jaas)

Details

(Keywords: fixed1.8, Whiteboard: [sg:fix])

Attachments

(1 file, 2 obsolete files)

The following AppleScript script opens a chrome:// URL in Firefox: tell application "DeerPark" activate Get URL "chrome://browser/content/" end tell From what Josh Aas has said to me, I think this is similar to how other Mac apps give URLs to Firefox, so this means other Mac apps (such as QuickTime?) could be abused to open chrome:// URLs in Firefox.
Flags: blocking1.8b4?
Yeah, we should probably not load chrome:// urls in the GetURL handler. Are there other protocols we should block (data:, res:)?
We need to either block or do the right thing with javascript: and data: URLs that come from external sources. I think that's covered by bug 304690.
If we disable the ability to open chrome URLs from other applications, would be be blocking functionality that is necessary for XULRunner? I've never really looked into XULRunner, so I'm not sure. I CC'd bsmedberg.
If that becomes a problem, we'll add a new AppleScript command that's equivalent to the -chrome command-line switch. We'll have to take that approach anyway assuming bug 286651 is fixed.
This does not affect xulrunner.
Assignee: nobody → joshmoz
Flags: blocking1.8b4? → blocking1.8b4+
Attached patch fix v1.0 (obsolete) (deleted) — Splinter Review
This should do it, but I don't have a built tree to test right now and I'm feeling to sick to ensure that this works anyway. My only concern is that if urlString is < 6 characters long it might crash. The documentation is a little unclear here, but it looks like it just stops comparing when it hits \0 string termination. If that is the case, then no need for an extra check and my patch should do fine.
Attachment #193637 - Flags: review?(sfraser_bugs)
Attachment #193637 - Flags: superreview?(sfraser_bugs)
Attachment #193637 - Flags: review?(sfraser_bugs)
Attachment #193637 - Flags: review?(mark)
Another concern about my patch - what if someone gives a URL that has a single space at the beginning. The test will fail, the URL will get sent. Is this really a problem? Again, can't test at the moment.
Comment on attachment 193637 [details] [diff] [review] fix v1.0 cancelling reviews, Mark should be posting an improved patch per our discussion on IRC
Attachment #193637 - Flags: superreview?(sfraser_bugs)
Attachment #193637 - Flags: review?(mark)
Attachment #193637 - Attachment is obsolete: true
Attached patch v1.1 (obsolete) (deleted) — Splinter Review
This builds on Josh's proposal by advancing past leading whitespace, looking for the trailing colon, and doing a case-insensitive comparison.
Attachment #193729 - Flags: superreview?(sfraser_bugs)
Attachment #193729 - Flags: review?(joshmoz)
Attachment #193729 - Flags: approval1.8b4?
Comment on attachment 193729 [details] [diff] [review] v1.1 please request approval after you've got sufficient reviews. thanks.
Attachment #193729 - Flags: approval1.8b4?
P.S. I think that this patch is necessary, but there's no likely exploit via the standard URL-passing channel. We don't tell the system that we handle chrome: URLs, so the system won't tell us when it gets a chrome: URL in the standard handlers (LSOpenCFURLRef, ICLaunchURL, or the Cocoa equivalent). The caller needs to explicitly specify Firefox, like the AppleScript in comment 0 does. That limits exposure quite a bit.
>This builds on Josh's proposal by advancing past leading whitespace, looking >for the trailing colon, and doing a case-insensitive comparison. It would probably be better to use Gecko's normal URL parsing stuff: get an nsIURI through nsIOService::NewURI and then using nsIURI::schemeIs to check whether it's a chrome URL.
Comment on attachment 193729 [details] [diff] [review] v1.1 You want to do what Jesse mentioned. We've been converting rogue callers over to nsIURI for a while, please use that wherever you're parsing URIs.
Attachment #193729 - Flags: superreview?(sfraser_bugs)
Attachment #193729 - Flags: review?(joshmoz)
Attachment #193729 - Flags: review-
Jesse: I talked to jst before writing my patch about doing the standard URI parsing and he said if we're not making that object anyway, then a strcmp-like check should be fine. Will change if other people feel different.
Attached patch v1.2 (deleted) — Splinter Review
As Josh said, the word was that the strcmp family would be OK here. Here it is using nsIURI instead.
Attachment #193729 - Attachment is obsolete: true
Attachment #193763 - Flags: superreview?(sfraser_bugs)
Attachment #193763 - Flags: review?(joshmoz)
shouldn't have removed the comment, and the variable should be called isBlockedScheme for clarity.
Attachment #193763 - Flags: superreview?(sfraser_bugs) → superreview+
Attachment #193763 - Flags: review?(joshmoz) → review+
Attachment #193763 - Flags: approval1.8b4?
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Attachment #193763 - Flags: approval1.8b4? → approval1.8b4+
...and branch.
Keywords: fixed1.8
Whiteboard: [sg:fix]
Group: security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: