Closed Bug 1749761 Opened 3 years ago Closed 3 years ago

Audit demuxer code

Categories

(Core :: Audio/Video: Playback, task)

task

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox-esr91 - wontfix
firefox97 --- wontfix
firefox98 - wontfix
firefox99 - fixed

People

(Reporter: padenot, Assigned: padenot)

References

Details

(Keywords: sec-audit, Whiteboard: [post-critsmash-triage][adv-main99-])

Attachments

(7 files, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #1748279 +++

We've had two similar sec-bugs recently (bug 1746011, bug 1737816), where the pattern was a negative number cast to unsigned. We should audit at least the other demuxers for this pattern, if not all casts from signed to unsigned (which might be a very long task).

https://searchfox.org/mozilla-central/search?q=&path=*demuxer*cpp&case=false&regexp=false

Thankfully, the mp4 demuxer in use is written in rust, at least there's that.

Group: partner-confidential
Group: core-security → media-core-security
Attachment #9258687 - Attachment description: WIP: Bug 1749761 - Fix signed->unsigned conversion in the ADTS demuxer. → Bug 1749761 - Fix signed->unsigned conversion in the ADTS demuxer.
Attachment #9258687 - Attachment description: Bug 1749761 - Fix signed->unsigned conversion in the ADTS demuxer. → WIP: Bug 1749761 - Fix signed->unsigned conversion in the ADTS demuxer.
Attachment #9258687 - Attachment description: WIP: Bug 1749761 - Fix signed->unsigned conversion in the ADTS demuxer. → Bug 1749761 - Fix signed->unsigned conversion in the ADTS demuxer. r?#media-playback-reviewers
Attachment #9258688 - Attachment description: WIP: Bug 1749761 - Fix signed->unsigned conversion in the WAV demuxer. → Bug 1749761 - Fix signed->unsigned conversion in the WAV demuxer. r?#media-playback-reviewers
Attachment #9258689 - Attachment description: WIP: Bug 1749761 - Fix signed->unsigned conversion in the MP3 demuxer. → Bug 1749761 - Fix signed->unsigned conversion in the MP3 demuxer. r?#media-playback-reviewers
Attachment #9258690 - Attachment description: WIP: Bug 1749761 - Fix signed->unsigned conversion in the OGG demuxer. → Bug 1749761 - Fix signed->unsigned conversion in the OGG demuxer. r?#media-playback-reviewers
Attachment #9258692 - Attachment description: WIP: Bug 1749761 - Fix signed->unsigned conversion in the FLAC demuxer. → Bug 1749761 - Fix signed->unsigned conversion in the FLAC demuxer. r?#media-playback-reviewers
Attachment #9258693 - Attachment description: WIP: Bug 1749761 - Fix signed->unsigned conversion in the WebM demuxer. → Bug 1749761 - Fix signed->unsigned conversion in the WebM demuxer. r?#media-playback-reviewers
Attached file signedness-warnings.py

Here's the script that checks that all implicit signed -> unsigned conversions have been dealt with. I run it like this on macOS, adjust for other OSes:

python3 ./signedness-warnings.py obj-x86_64-apple-darwin20.6.0/.mozbuild/warnings.json

This needs the patch marked DO NOT LAND to work, as it's based off a C++ compiler warning.

Tom, we've finished this audit and the code pattern isn't present in demuxers anymore. No other issue has been found, should we land this now or do you want a security-approval form ?

Time permitting, I'd like the media code to be a bit more careful about integer types, ideally we'd do it gradually and enable Wconversion in our directories, but we can land this now.

Flags: needinfo?(tom)

If any of these are issues, they're probably sec-high, so thanks for asking. Either way I think they'll draw attention, but I don't think there's anything we can do to mitigate that, so consider them sec-approved to land and request uplift.

Flags: needinfo?(tom)
Group: media-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
Flags: qe-verify-
Whiteboard: [post-critsmash-triage]

(In reply to Tom Ritter [:tjr] (ni? for response to CVE/sec-approval/advisories/etc) from comment #10)

If any of these are issues, they're probably sec-high, so thanks for asking. Either way I think they'll draw attention, but I don't think there's anything we can do to mitigate that, so consider them sec-approved to land and request uplift.

Do we want them in 91 and 98 as well, considering I haven't found any issues ?

Flags: needinfo?(tom)

You're saying you don't think any of them are actual vulnerabilities? If so then no, we don't need to uplift.

Flags: needinfo?(tom)

(In reply to Paul Adenot (:padenot) from comment #12)

Do we want them in 91 and 98 as well, considering I haven't found any issues ?

Can you clarify whether this means that you haven't found any issues with the patches since they landed (and therefore are ready for uplift) or whether you haven't found any exploitable conditions with them (and hence don't need to uplift)? Thanks!

Flags: needinfo?(padenot)

I haven't found any exploitable condition or preexisting bug that could have been uplifter, all those patches were merely fixing the compiler warnings I enabled so I could make sure I caught all instances of the problems, and start working our way to enabled this compiler warning permanently.

Let's not uplift those then, thanks!

Flags: needinfo?(padenot)
Whiteboard: [post-critsmash-triage] → [post-critsmash-triage][adv-main99-]
Attachment #9258695 - Attachment is obsolete: true
Group: core-security-release
Regressions: 1798778
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: