stack-buffer-overflow webaudio/AudioEventTimeline.cpp:510 in AudioEventTimeline::GetValuesAtTimeHelperInternal
Categories
(Core :: Web Audio, defect, P1)
Tracking
()
People
(Reporter: m.cooolie, Assigned: karlt)
References
(Regression)
Details
(4 keywords, Whiteboard: [reporter-external] [client-bounty-form] [verif?][adv-main122+])
Attachments
(7 files)
780 bytes,
text/html
|
Details | |
11.46 KB,
text/plain
|
Details | |
18.48 KB,
text/javascript
|
Details | |
48 bytes,
text/x-phabricator-request
|
tjr
:
sec-approval+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
193 bytes,
text/plain
|
Details |
#Reproduce
OS:Win10 X64
123.0a1 (2023-12-19) (64-bit)
#Step:
- python -m http.server 1337
- python -m ffpuppet firefox.exe -p prefs.js -d -u http://localhost:1337/poc.html
#Analysis
missing boundary checks for ticks + start, detune + start, end - start
https://searchfox.org/mozilla-central/source/dom/media/webaudio/OscillatorNode.cpp#300
void ProcessBlock(AudioNodeTrack* aTrack, GraphTime aFrom,
const AudioBlock& aInput, AudioBlock* aOutput,
bool* aFinished) override {
MOZ_ASSERT(mSource == aTrack, "Invalid source track");
TRACE("OscillatorNodeEngine::ProcessBlock");
TrackTime ticks = mDestination->GraphTimeToTrackTime(aFrom);
if (mStart == -1) {
ComputeSilence(aOutput);
return;
}
if (ticks + WEBAUDIO_BLOCK_SIZE <= mStart || ticks >= mStop) {
ComputeSilence(aOutput);
} else {
aOutput->AllocateChannels(1);
float* output = aOutput->ChannelFloatsForWrite(0);
uint32_t start, end;
FillBounds(output, ticks, start, end);
float frequency[WEBAUDIO_BLOCK_SIZE];
float detune[WEBAUDIO_BLOCK_SIZE];
if (ParametersMayNeedUpdate()) {
if (mFrequency.HasSimpleValue()) {
std::fill_n(frequency, WEBAUDIO_BLOCK_SIZE, mFrequency.GetValue());
} else {
mFrequency.GetValuesAtTime(ticks + start, frequency + start,
end - start);
}
if (mDetune.HasSimpleValue()) {
std::fill_n(detune, WEBAUDIO_BLOCK_SIZE, mDetune.GetValue());
} else {
mDetune.GetValuesAtTime(ticks + start, detune + start, end - start);
}
}
Updated•11 months ago
|
Updated•11 months ago
|
Assignee | ||
Updated•11 months ago
|
Comment 3•11 months ago
|
||
Set release status flags based on info from the regressing bug 1853598
Assignee | ||
Comment 4•11 months ago
•
|
||
end
< start
, which always leads to 2^32 - 126 <= aSize
< 2^32, for a write controlled by content. The loop on this (audio rendering) thread will eventually seg fault before exiting. If the OS has a guard page at the high address end of the stack, then I don't see a way for memory accessed by other threads to be corrupted. This thread does not perform nested event loops and so the stack should not grow large, even in unoptimized builds without a stack limit.
Assignee | ||
Comment 5•11 months ago
|
||
OscillatorNode is now similar in this way to ConstantSourceNode.
https://searchfox.org/mozilla-central/rev/f6776253b65c05351b4004fe7c3353cac8d8a4af/dom/media/webaudio/ConstantSourceNode.cpp#88-89
Assignee | ||
Comment 6•11 months ago
|
||
Depends on D197405
Updated•11 months ago
|
Updated•11 months ago
|
Assignee | ||
Comment 7•11 months ago
|
||
Comment on attachment 9370470 [details]
Bug 1871838 simply produce silence if stop time is before start time r?padenot
Security Approval Request
- How easily could an exploit be constructed based on the patch?: I'm not aware of a way to exploit this beyond DoS (comment 4), despite the content-controlled stack buffer write overflow.
The first change in the patch is necessary and identifies how to trigger a crash.
The second change is an assert identifying the flaw, and could be removed if preferred. - Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: No
- Which older supported branches are affected by this flaw?: Versions from Fx 119
- If not all supported branches, which bug introduced the flaw?: Bug 1853598
- Do you have backports for the affected branches?: Yes
- If not, how different, hard to create, and risky will they be?: Same. Easy.
- How likely is this patch to cause regressions; how much testing does it need?: Very unlikely. Change is small and similar to existing code elsewhere.
- Is Android affected?: Yes
Comment 8•11 months ago
|
||
Comment on attachment 9370470 [details]
Bug 1871838 simply produce silence if stop time is before start time r?padenot
Approved to land and request uplift
Updated•11 months ago
|
Comment 10•11 months ago
|
||
Comment 11•11 months ago
|
||
The patch landed in nightly and beta is affected.
:karlt, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox122
towontfix
.
For more information, please visit BugBot documentation.
Updated•11 months ago
|
Assignee | ||
Comment 12•11 months ago
|
||
OscillatorNode is now similar in this way to ConstantSourceNode.
https://searchfox.org/mozilla-central/rev/f6776253b65c05351b4004fe7c3353cac8d8a4af/dom/media/webaudio/ConstantSourceNode.cpp#88-89
Original Revision: https://phabricator.services.mozilla.com/D197405
Updated•11 months ago
|
Comment 13•11 months ago
|
||
Uplift Approval Request
- Needs manual QE test: no
- Is Android affected?: yes
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Risk associated with taking this patch: very low
- String changes made/needed: none
- Explanation of risk level: Change is small and similar to existing code elsewhere. Affects only OscillatorNode
- Steps to reproduce for manual QE testing: Load https://bugzilla.mozilla.org/attachment.cgi?id=9370190
- User impact if declined: content-controlled stack buffer write overflow
Updated•11 months ago
|
Updated•11 months ago
|
Comment 14•11 months ago
|
||
uplift |
Assignee | ||
Updated•11 months ago
|
Updated•11 months ago
|
Updated•10 months ago
|
Comment 15•10 months ago
|
||
Updated•10 months ago
|
Comment 16•9 months ago
|
||
a month ago, tjr placed a reminder on the bug using the whiteboard tag [reminder-test 2024-03-05]
.
karlt, please refer to the original comment to better understand the reason for the reminder.
Comment 17•9 months ago
|
||
Comment 18•9 months ago
|
||
Comment 19•6 months ago
|
||
Making Firefox 122 security bugs public. [bugspam filter string: Pilgarlic-Towers]
Updated•6 months ago
|
Description
•