signalapp / mp4san

A Rust MP4 format sanitizer
MIT License
10 stars 4 forks source link

Add dimension limit for alpha chunks #12

Open jessa0 opened 1 year ago

jessa0 commented 1 year ago

The VP8X chunk allows specifying ridiculously large canvas dimensions up to 2^24 x 2^24, which end up being used for ALPH chunk bitstreams. This can be a DoS vector. It's unclear whether there's a valid WebP with such large dimensions, as both the VP8 and VP8L bitstreams only allow dimensions up to 2^12 x 2^12. In other words, a larger ALPH would be rejected later anyway in parsing for mismatching dimensions with the VP8/VP8L appearing later.