This vulnerability occurs when software processes numeric input expecting standard decimal numbers (base 10), but fails to handle inputs formatted in other bases like octal or hexadecimal. This mismatch leads to the system interpreting the same digits as a completely different numeric value.
The core issue often arises from functions that automatically interpret numeric prefixes. A leading '0' can trigger octal parsing, while '0x' indicates hexadecimal. For instance, the IP address '0127.0.0.1' is read as octal, becoming equivalent to 87.0.0.1 in decimal—a stark and dangerous difference from the intended 127.0.0.1 (localhost). Common C functions like `inet_addr()` exhibit this behavior, but the problem can appear in any parsing logic that doesn't explicitly define or validate the input's radix. In practice, this parsing flaw can have severe security consequences. An attacker can exploit it to bypass security controls, such as network allow/deny lists or SSRF (Server-Side Request Forgery) filters, by supplying an IP address or identifier that looks correct to a developer but resolves to a different, permitted address. It can also corrupt data flows when identifiers that resemble numbers with leading zeros are processed incorrectly, leading to logical errors and unexpected system behavior.
Impact: Read Application Data
An attacker may use an unexpected numerical base to access private application resources.
Impact: Bypass Protection MechanismAlter Execution Logic
An attacker may use an unexpected numerical base to bypass or manipulate access control mechanisms.
Strategy: Enforcement by Conversion
Strategy: Input Validation
Strategy: Input Validation
python
python
pythonpython
pythonother