Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade ascii
to version 0.9.3 or higher.
ascii is a library that provides ASCII-only string and character types, equivalent to the char, str and String types in the standard library.
Affected versions of this package are vulnerable to Out-of-Bounds due to insecure implementation of From<&mut AsciiStr>
for &mut [u8]
and &mut str
, which allows writing non-ASCII values to an AsciiStr
which when read out as an AsciiChar
will produce values outside the valid niche.
let mut buf = [0u8; 1];
let ascii = buf.as_mut_ascii_str().unwrap();
let byte_view = <&mut[u8] as From<&mut AsciiStr>>::from(ascii);
let arr = [0b11011101u8; 128];
byte_view[0] = 180;
assert_ne!(arr[ascii[0] as u8 as usize], 0b11011101);