Bug 1991962 (CVE-2021-29922) - CVE-2021-29922 rust: incorrect parsing of extraneous zero characters at the beginning of an IP address string
Summary: CVE-2021-29922 rust: incorrect parsing of extraneous zero characters at the b...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2021-29922
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1994684 1994701
Blocks: 1991963
TreeView+ depends on / blocked
 
Reported: 2021-08-10 13:41 UTC by Guilherme de Almeida Suckevicz
Modified: 2021-11-09 18:01 UTC (History)
9 users (show)

Fixed In Version: rust 1.53.0
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in rust. Extraneous zero characters at the beginning of an IP address string are not properly considered which can allow an attacker to bypass IP-based access controls. The highest threat from this vulnerability is to data confidentiality and integrity.
Clone Of:
Environment:
Last Closed: 2021-11-02 23:37:37 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4270 0 None None None 2021-11-09 18:01:35 UTC

Description Guilherme de Almeida Suckevicz 2021-08-10 13:41:23 UTC
library/std/src/net/parser.rs in Rust before 1.53.0 does not properly consider extraneous zero characters at the beginning of an IP address string, which (in some situations) allows attackers to bypass access control that is based on IP addresses, because of unexpected octal interpretation.

References:
https://github.com/rust-lang/rust/issues/83648
https://github.com/sickcodes/security/blob/master/advisories/SICK-2021-015.md

Upstream patch:
https://github.com/rust-lang/rust/pull/83652

Comment 3 Todd Cullum 2021-08-17 19:19:38 UTC
Flaw summary:

Rust standard library's IpV4Addr would interpret leading zeroes like 0127.0.0.1 as the address 127.0.0.1. However, some applications may expect this same literal to be interpreted as 87.0.0.1 due to the original IPv4 specification allowing octal numbers. The upstream patch simply rejects octal numbers rather than parsing them as decimal.

Comment 5 errata-xmlrpc 2021-11-09 18:01:33 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:4270 https://access.redhat.com/errata/RHSA-2021:4270


Note You need to log in before you can comment on or make changes to this bug.