You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 21, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on May 21, 2025. It is now read-only.
Malformed string compression table causes panic/abort in parser #2
let compressed_data = table_data.read_bytes(compressed_size asusize - 4)?;
, if compressed_size is less than 4, it will either panic on wraparound with debug assertions enabled, or tries to allocate a huge amount of memory in release mode, and aborts. (This could probably be used cause a denial of service by trying to allocate large buffers).
The fix here IMO is to do a checked subtraction there, but also not to trust the value we got from the file for the compressed size. That might be a change in bitbuffer too, which should have tests that trying to read huge amounts of data doesn't crash, and instead returns an error, which it doesn't seem to be doing.
I don't think a very large compressed_size is an issue since the bitbuffer will check that there are compressed_size - 4 bytes in the table data before allocating the buffer.
Activity
icewind1991 commentedon May 22, 2021
I don't think a very large
compressed_sizeis an issue since thebitbufferwill check that there arecompressed_size - 4bytes in the table data before allocating the buffer.icewind1991 commentedon May 23, 2021
Ah yes, I didn't think about the decompression step itself, bb79d26 adds some hard limits for compressed and decompressed size (10mb and 100mb)