New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 769522 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Security

Blocked on:
issue v8:6841



Sign in to add a comment

Security: WebAssembly potential arbitrary code execution in render process with trap handlers

Project Member Reported by eholk@chromium.org, Sep 27 2017

Issue description

VULNERABILITY DETAILS
Please provide a brief explanation of the security issue.

See https://crbug.com/v8/6841

WebAssembly can use signal handlers to catch out of bounds access and recover by throwing a JavaScript exception. This requires metadata about what instruction might fault and a landing pad for each instruction. We found a case where the metadata was not removed when a Wasm instance was collected which could lead to another instance incorrectly matching stale data. This could lead to an out of bounds access leading to a jump to an unexpected location, which could potentially be attacker-controlled.


VERSION
Chrome Version: 62 Beta
Operating System: Linux x64 only

REPRODUCTION CASE

In a V8 checkout:

./out.gn/x64.debug/d8 --test --random-seed=-976563914 --stress-opt --always-opt --nohard-abort test/wasm-spec-tests/tests/memory_trap.js --wasm-trap-handler --stress-runs=5


I haven't actually exploited the bug, but it seems likely to be exploitable.

Suppose we had some compiled Wasm that looked kind of like this:

0: load memory
...
...
13: throw OutOfBoundsException

The handler data table would have an entry for (0, 13), which means if the exception at offset 0 faults, then jump to offset 13 to throw the exception.

If this entry leaked (by destroying an instance and re-instantiating the same module), and then later we compiled a function that generated code like:

0: load memory
...
...
12: load immediate

Then if the immediate was at offset 13, a fault would lead to whatever value was in the immediate field being executed as code. This would only be about 4 bytes of attacker-controlled code, but this is probably enough to build more interesting exploits.
 
Components: Blink>JavaScript>WebAssembly
Labels: OS-Linux
Status: Untriaged (was: Unconfirmed)
Cc: ishell@chromium.org ahaas@chromium.org
Labels: Security_Severity-High Security_Impact-Stable M-62 Pri-1
Owner: clemensh@chromium.org
Status: Assigned (was: Untriaged)
Cc: clemensh@chromium.org
Owner: eholk@chromium.org

Comment 4 by eholk@chromium.org, Sep 28 2017

Status: Fixed (was: Assigned)
The fix has been merged into V8 6.2 and should be in the next roll into Chromium.

https://crrev.com/c/690736

Project Member

Comment 5 by sheriffbot@chromium.org, Sep 29 2017

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify

Comment 6 by awhalley@google.com, Oct 16 2017

Labels: Release-0-M62
Project Member

Comment 7 by sheriffbot@chromium.org, Oct 27 2017

Labels: Merge-Request-63
Project Member

Comment 8 by sheriffbot@chromium.org, Oct 27 2017

Labels: -Merge-Request-63 Merge-Review-63 Hotlist-Merge-Review
This bug requires manual review: M63 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), gkihumba@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 9 by gov...@chromium.org, Oct 27 2017

Cc: awhalley@chromium.org
+awhalley@ (Security TPM) for M63 merge review
Labels: -Hotlist-Merge-Review -Merge-Review-63
No 63 merge needed.
Project Member

Comment 11 by sheriffbot@chromium.org, Jan 5 2018

Labels: -Restrict-View-SecurityNotify allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 12 by sheriffbot@chromium.org, Mar 27 2018

Labels: -M-62 M-65

Sign in to add a comment