Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .oss-scanner/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM rust:1-trixie

WORKDIR /src
COPY . /src

# The scanner clones without submodules. The AVIF tests need both fixture sets.
# cargo fetch also creates the workspace lockfile in a fresh checkout.
RUN git submodule update --init --recursive \
&& cargo fetch

# The scanner runs offline. Check both the default and Firefox feature sets.
ENV CARGO_NET_OFFLINE=true
RUN --network=none cargo build --workspace --locked \
&& cargo test --workspace --locked \
&& cargo test --workspace --locked --features missing-pixi-permitted
23 changes: 23 additions & 0 deletions .oss-scanner/threat_model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# mp4parse-rust threat model

Firefox uses `mp4parse_capi` to read metadata from MP4 and AVIF files.
Web content can supply the entire file. Treat its bytes, including container
sizes, offsets, counts, and metadata, as untrusted.

## Scope

- Review the Rust MP4 and AVIF parsers (`read_mp4` and `read_avif`) and the C API
(`mp4parse_new` and `mp4parse_avif_new`), including how the C API exposes
parsed metadata and sample tables to its callers.
- Include the default configuration and `missing-pixi-permitted`, which Firefox
enables. Treat C callers and their callbacks as trusted and assume they meet
the documented pointer and lifetime contracts.
- Firefox integration code, downstream decoders, and the test fixture
submodules are outside this repository's review scope.

## Security impact

Prioritize memory safety and violations of the C API's documented guarantees
that malicious media can trigger. Consider crashes and disproportionate CPU or
memory use when they affect a realistic consumer. Rejecting malformed media
with a parse error is expected behavior.
Loading