Skip to content

Commit cc892a6

Browse files
authored
Add unsound mozjpeg (#1389)
1 parent f56c700 commit cc892a6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

crates/mozjpeg/RUSTSEC-0000-0000.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
```toml
2+
[advisory]
3+
id = "RUSTSEC-0000-0000"
4+
package = "mozjpeg"
5+
date = "2020-07-04"
6+
keywords = ["type confusion"]
7+
url = "https://github.com/ImageOptim/mozjpeg-rust/issues/10"
8+
categories = ["memory-corruption"]
9+
references = ["https://github.com/kornelski/rust-rgb/issues/35", "https://rustsec.org/advisories/RUSTSEC-2020-0029.html"]
10+
informational = "unsound"
11+
12+
[affected]
13+
functions = { "mozjpeg::DecompressScanlines::read_scanlines" = ["< 0.8.19"] }
14+
15+
[versions]
16+
patched = [">= 0.8.19"]
17+
```
18+
# mozjpeg DecompressScanlines::read_scanlines is Unsound
19+
20+
This issue and vector is similar to [RUSTSEC-2020-0029] of `rgb` crate which `mozjpeg` depends on.
21+
22+
Affected versions of `mozjpeg` crate allow creating instances of any type `T` from bytes,
23+
and do not correctly constrain `T` to the types for which it is safe to do so.
24+
25+
Examples of safety violation possible for a type `T`:
26+
27+
* `T` contains a reference type, and it constructs a pointer to an invalid, arbitrary memory address.
28+
* `T` requires a safety and/or validity invariant for its construction that may be violated.
29+
30+
The issue was fixed in 0.8.19 by using safer types and involving `rgb` dependency bump.
31+
32+
[RUSTSEC-2020-0029]: https://rustsec.org/advisories/RUSTSEC-2020-0029.html

0 commit comments

Comments
 (0)