Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
RUSTSEC-2020-0006
No affected components available
When reallocing, if we allocate new space, we need to copy the old
allocation's bytes into the new space. There are old_size number of bytes in
the old allocation, but we were accidentally copying new_size number of bytes,
which could lead to copying bytes into the realloc'd space from past the chunk
that we're bump allocating out of, from unknown memory.
If an attacker can cause reallocs, and can read the realoced data back,
this could allow them to read things from other regions of memory that they
shouldn't be able to. For example, if some crypto keys happened to live in
memory right after a chunk we were bump allocating out of, this could allow
the attacker to read the crypto keys.
Beyond just fixing the bug and adding a regression test, I've also taken two additional steps:
-
While we were already running the testsuite under
valgrindin CI, becausevalgrindexits with the same code that the program did, if there are invalid reads/writes that happen not to trigger a segfault, the program can still exit OK and we will be none the wiser. I've enabled the--error-exitcode=1flag forvalgrindin CI so that tests eagerly fail in these scenarios. -
I've written a quickcheck test to exercise
realloc. Without the bug fix in this patch, this quickcheck immediately triggers invalid reads when run undervalgrind. We didn't previously have quickchecks that exercisedreallocbecausereallocisn't publicly exposed directly, and instead can only be indirectly called. This new quickcheck test exercisesreallocviabumpalo::collections::Vec::resizeandbumpalo::collections::Vec::shrink_to_fitcalls.
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. No user interaction is needed for the attacker to exploit this vulnerability. The impact is confined to the system where the vulnerability exists. There is a high impact on the confidentiality of the information.
Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard