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
The cause is fairly straight forward: a vector is being eagerly allocated and zerod, its size is picked verbatim from the byte stream. So a few bytes worth of payload can therefore be used to allocate as much memory as you want to on the target machine without it actually being filled with any input data.
There are several ways to mitigate this:
Apply a limit to how much you pre-allocate when allocating data structures. They will then asymptotically grow as they're being filled with input. This is the most common approach, and this way in order to actually cause huge allocations, a huge amount of input data has to be processed as well which usually is already limited.
You can apply a limit to how much you'll allocate in total. But that's hard with rust allocation APIs being unstable right now. I will certainly do this when allocator apis are stable.
The text was updated successfully, but these errors were encountered:
Your comment was quite surprising to me.
I've addressed this issue by limiting the allocation of Vec to a maximum of 128.
This fix has been released in version 0.1.6.
I sincerely thank you for your detailed report and the method of reproduction.
Found through fuzzing, should be reproducible if you check out musli and run this:
MIRI backtrace
This is the problematic line: https://github.com/otake84/dlhn/blob/6f25c178a255c93eab6f18aa3ca5e4b11b504380/dlhn/src/de.rs#LL58C12-L58C12.
The cause is fairly straight forward: a vector is being eagerly allocated and zerod, its size is picked verbatim from the byte stream. So a few bytes worth of payload can therefore be used to allocate as much memory as you want to on the target machine without it actually being filled with any input data.
There are several ways to mitigate this:
The text was updated successfully, but these errors were encountered: