Closed Bug 1881218 Opened 2 years ago Closed 27 days ago

AddressSanitizer: heap-buffer-overflow [@ __asan_memcpy] with READ of size 1536 (unsupported config)

Categories

(Core :: Audio/Video, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1605894
Tracking Status
firefox-esr115 --- disabled
firefox123 --- disabled
firefox124 --- disabled
firefox125 --- disabled

People

(Reporter: decoder, Unassigned)

References

(Blocks 1 open bug)

Details

(5 keywords)

Attachments

(1 file)

The attached crash information was submitted via the ASan Nightly Reporter on mozilla-central-asan-nightly revision 121.0a1-20231101093520-https://hg.mozilla.org/mozilla-central/rev/b73ef4c8979fb0702de9f4bf2fdf986b1d0fd487.

For detailed crash information, see attachment.

This is an older bug report from November that was buried in a flurry of other reports that are likely bad hardware. This one looks legit though, it reports an OOB write here:

https://hg.mozilla.org/mozilla-central/file/b73ef4c8979fb0702de9f4bf2fdf986b1d0fd487/dom/media/AudioSegment.cpp#l201

The code has been refactored since but I believe I see the issue in the current code. If this overflows:

https://searchfox.org/mozilla-central/rev/c26f7461fc2a51196b7f517c7f98a1e271dc9ec0/dom/media/AudioSegment.cpp#247

then we might end up creating pointers in PointerForOffsetInChannel that point OOB and cause such writes. Unless we have fixed this somehow somewhere else (with checks on duration and channel), I assume this is still valid.

Group: core-security → media-core-security

Sorry I forgot to follow-up here. The stack indicate that the report comes from a Firefox with at least 2 prefs flipped:

  • activating fake media engine, which is something that we use in CI when there's no webcam / microphone -- this is known to be clean with our usual sanitizers and fuzzers
  • activating audio tab capture, which is something that is known unmaintained, preffed of, but not removed because we might finish it and pref it one for a Web Extension API. There is a known crash there that looks like this one, but I can't seem to be able to find it, maybe someone could give me the list of stalled asan bug related to media ?
Blocks: tab-sharing
Severity: critical → S3

The severity field for this bug is set to S3. However, the bug is flagged with the sec-high keyword.
:jimm, could you consider increasing the severity of this security bug?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)
Flags: needinfo?(jmathies)
Blocks: audio-sharing
No longer blocks: tab-sharing

Stalled for now but we'll get back to this if and when we work on audio sharing support.

Keywords: stalled
Summary: AddressSanitizer: heap-buffer-overflow [@ __asan_memcpy] with READ of size 1536 → AddressSanitizer: heap-buffer-overflow [@ __asan_memcpy] with READ of size 1536 (unsupported config)

This is an automated comment. To help with triage and priority, we are experimenting with an automated exploitation analysis.

A proof-of-concept was attempted, and controlled exploitation is not feasible based on this analysis. The issue was considered an out of bounds read from a format confusion in AudioSegment::Mix, where int16 sample data was read as float, and control of the read extent and location was attempted, however sufficient control could not be demonstrated. After reverting the incidental fix (Bug 1605894) the original over-read was reproduced via getUserMedia audio capture, but the OOB extent is fixed at frames times two bytes where frames is the backend cubeb callback block size that web content cannot influence, the location is zero bytes past a heap-groomable but not address-chosen SharedBuffer, and the destination write is in-bounds so there is no write primitive. The path also requires an off-by-default pref.

Based on this analysis, the bug is being reclassified as sec-moderate. If this bug was submitted for a bounty, it is unlikely to be awarded one unless some control can be demonstrated. If this analysis is demonstrably incorrect, please needinfo :tjr.

Keywords: sec-high → sec-moderate

Automatic triage (under development): deduplication
No validation or verification has been performed.

This issue has been determined to be a duplicate of bug 1605894.

Both report the same heap-buffer-overflow read in PodCopy<float> from AudioSegment::Mix, called from AudioCaptureTrack::ProcessInput. In both, the read goes past a SharedBuffer allocated by the fake audio source (AudioSourcePullListener::NotifyPull) because its 16-bit samples are read as float. This report came from a build of 2023-11-01, before the AudioSegment::Mix S16 fix landed.

Status: NEW → RESOLVED
Closed: 27 days ago
Duplicate of bug: 1605894
Resolution: --- → DUPLICATE

Since the bug is closed, the stalled keyword is now meaningless.
For more information, please visit BugBot documentation.

Keywords: stalled
Group: media-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: