Category: Coding Mistakes
Hex decode accepting invalid characters
Low Severity
Low Impact
Low Likelihood
Description
The hex.move module provides helper functions that can be used to convert a bytes array to and from a hexadecimal representation.
The decode_string
accepts characters that are not valid hexadecimals and decodes characters that are not in the range 0-9a-f
. This causes the strings 1f
and 0g
to be decoded to the value 0x1f
.
Impact
This issue is reported as low impact since we could not identify an exploitation path using only the in-scope code. However, the impact could be higher for third-party modules.
Recommendations
Validate the input to ensure it contains only valid hexadecimal characters.