Bounds check ref.func function index in global initializers
Categories
(Core :: JavaScript: WebAssembly, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox76 | --- | unaffected |
firefox77 | --- | disabled |
firefox78 | --- | fixed |
People
(Reporter: rhunt, Assigned: rhunt)
References
(Regression)
Details
(Keywords: csectype-bounds, regression, sec-high, Whiteboard: [post-critsmash-triage][sec-survey])
Attachments
(2 files)
The decoder for ref.func in wasm globals doesn't bounds check the function index and later code assumes that it's valid [1] [2].
Being a bit paranoid here, I'm not sure if this could be exploited. This code is nightly only and this is a recent regression.
[1] https://searchfox.org/mozilla-central/rev/0688ffdef223dac527c2fcdb25560118c4e4df51/js/src/wasm/WasmValidate.cpp#2309
[2] https://searchfox.org/mozilla-central/rev/0688ffdef223dac527c2fcdb25560118c4e4df51/js/src/wasm/WasmGenerator.cpp#401
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D74970
Updated•5 years ago
|
Comment 3•5 years ago
|
||
Set release status flags based on info from the regressing bug 1612804
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Being equally paranoid we'll call this sec-high. We should never ever trust wasm to be well formed.
![]() |
||
Comment 6•5 years ago
|
||
https://hg.mozilla.org/integration/autoland/rev/51706a543abf9fd2ad8812eb145db67f81c39217
https://hg.mozilla.org/mozilla-central/rev/51706a543abf
Updated•5 years ago
|
Comment 7•5 years ago
|
||
As part of a security bug pattern analysis, we are requesting your help with a high level analysis of this bug. It is our hope to develop static analysis (or potentially runtime/dynamic analysis) in the future to identify classes of bugs.
Please visit this google form to reply.
Updated•5 years ago
|
Comment 9•5 years ago
|
||
Test case has bitrotted: file moved from .../gc/... to .../ref-types/... and when suitably fixed it fails with a bunch of unrelated assertions, but this looks like it's localized to the test runner (conflicting definitions of globalSection). Will update and land.
Comment 10•5 years ago
|
||
Actually, Ryan - did this land, but without closing the patch? There's code at the bottom of ref-types/ref-func.js that looks a lot like this, but some of the names are changed.
Updated•5 years ago
|
Assignee | ||
Comment 11•5 years ago
|
||
I don't think this landed, which code are you looking at? This code [1] doesn't seem to be it.
Also, I can rebase the patch and land it now.
Comment 12•5 years ago
|
||
Comment 13•5 years ago
|
||
Backed out for SM bustages on asserts.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/6cfaa4fa1c1f3478074a0fec28155d28fa301345
Log link: https://treeherder.mozilla.org/logviewer?job_id=326706819&repo=autoland&lineNumber=11245
Assignee | ||
Comment 14•5 years ago
|
||
Ah, Cranelift uses a different failure message here and I didn't test on ARM64.
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•