Closed Bug 938111 Opened 11 years ago Closed 11 years ago

Purge the developer tools of innerHTML: Editor - openDialog codemirror extension

Categories

(DevTools :: General, defect, P2)

x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 28

People

(Reporter: mgoodwin, Assigned: anton)

References

Details

(Keywords: sec-want)

Attachments

(1 file, 1 obsolete file)

CodeMirror manages to completely avoid use of innerHTML (yay!) but our openDialog extension doesn't. This is unfortunate as, whilst this is not exploitable at present, the use of innerHTML now is a common cause of vulnerability later.

See: https://mxr.mozilla.org/mozilla-central/source/browser/devtools/sourceeditor/codemirror/dialog/dialog.js#13
Assignee: nobody → anton
Priority: -- → P2
Opened a pull request for the proposed change: https://github.com/marijnh/CodeMirror/pull/1963. Depending on the response, I'll either pull the latest version of CM3 into the tree or modify dialog addon and update READMEs. After that, it's super easy to update extensions that rely on this addon (only search and jump to line AFAIK).
Blocks: 816756
Attached patch WIP 1 (obsolete) — Splinter Review
This patch imports my patch to CodeMirror [1] and changes jumpToLine and search functionality to use DOM nodes instead of innerHTML. It doesn't touch replace dialogs because we don't use them.

[1] https://github.com/marijnh/CodeMirror/pull/1963
Attachment #8335581 - Flags: review?(fayearthur)
Comment on attachment 8335581 [details] [diff] [review]
WIP 1

Review of attachment 8335581 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/devtools/sourceeditor/codemirror/search/search.js
@@ +53,5 @@
> +      let txt = doc.createTextNode(cm.l10n("findCmd.promptMessage"));
> +
> +      inp.type = "text";
> +      inp.style.width = "10em";
> +      inp.style.marginLeft = "1em";

marginLeft -> mozMarginStart

::: browser/devtools/sourceeditor/editor.js
@@ +627,5 @@
> +    let txt = doc.createTextNode(L10N.GetStringFromName("gotoLineCmd.promptTitle"));
> +
> +    inp.type = "text";
> +    inp.style.width = "10em";
> +    inp.style.marginLeft = "1em";

mozMarginStart
Attachment #8335581 - Flags: review?(fayearthur) → review+
Whiteboard: [fixed-in-fx-team]
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/5bb4635154f9
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 28
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: