Closed Bug 1408018 Opened 8 years ago Closed 8 years ago

Should Browser Console execute code?

Categories

(DevTools :: Console, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: baku, Unassigned)

Details

Browser console can be used to execute code at a chrome privilege level. Since 57, addons cannot execute chrome code anymore but we still allow Browser Console to do it. Wondering if we can block this and have the Browser Console just as a log viewer. Note that we already have security issues: bug 1407740 and bug 1407751.
The input prompt is only available when devtools.chrome.enabled=true. Since that pref also allows the Browser Toolbox to be opened (where you can execute arbitrary chrome privileged code) I don't think there's a particular problem with allowing the Browser Console input as well. What do you think?
Flags: needinfo?(amarchesini)
(In reply to Brian Grinstead [:bgrins] from comment #1) > The input prompt is only available when devtools.chrome.enabled=true. Since > that pref also allows the Browser Toolbox to be opened (where you can > execute arbitrary chrome privileged code) I don't think there's a particular > problem with allowing the Browser Console input as well. What do you think? I guess it's important to define the target of this feature: if it's used for internal development, it makes sense to keep this feature. Otherwise, having a way to run chrome code, especially after 57, seems not particularly useful. Feel free to close this bug as INVALID if this is the case.
Flags: needinfo?(amarchesini) → needinfo?(bgrinstead)
Why should the browser console stop being able to run code just because add-ons have been dumbified? I use it lots of times despite I have never created an add-on. And it's not like limiting the browser console would completely disable running privileged code. One could also use the web console in a privileged page, or Scratchpad. It would just be more annoying.
When working on browser code, I regularly use the Browser Console to check state, try things, etc. So, I would hope to see this preserved, at least for local development.
(In reply to Andrea Marchesini [:baku] from comment #2) > (In reply to Brian Grinstead [:bgrins] from comment #1) > > The input prompt is only available when devtools.chrome.enabled=true. Since > > that pref also allows the Browser Toolbox to be opened (where you can > > execute arbitrary chrome privileged code) I don't think there's a particular > > problem with allowing the Browser Console input as well. What do you think? > > I guess it's important to define the target of this feature: if it's used > for internal development, it makes sense to keep this feature. Otherwise, > having a way to run chrome code, especially after 57, seems not particularly > useful. > > Feel free to close this bug as INVALID if this is the case. Yeah, the primary target for the input field on the Browser Console is for Firefox development. Since the input field is hidden using the same pref that hide the Browser Toolbox and other chrome debugging tools, I don't think we need to make a special case here.
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(bgrinstead)
Resolution: --- → INVALID
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.