Bug 2235162 (CVE-2023-40022)

Summary: CVE-2023-40022 rizin: Integer Overflow in C++ demangler logic
Product: [Other] Security Response Reporter: Mauro Matteo Cascella <mcascell>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedKeywords: Security
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2235164, 2235165    
Bug Blocks:    

Description Mauro Matteo Cascella 2023-08-27 10:17:12 UTC
Rizin is a UNIX-like reverse engineering framework and command-line toolset. Versions 0.6.0 and prior are vulnerable to integer overflow in `consume_count` of `src/gnu_v2/cplus-dem.c`. The overflow check is valid logic but, is missing the modulus if the block once compiled. The compiler sees this block as unreachable code since the prior statement is multiplication by 10 and fails to consider overflow assuming the count will always be a multiple of 10. Rizin version 0.6.1 contains a fix for the issue. A temporary workaround would be disabling C++ demangling using the configuration option `bin.demangle=false`.

Upstream references:
https://github.com/rizinorg/rizin/security/advisories/GHSA-92h6-wwc2-53cq
https://github.com/rizinorg/rz-libdemangle/commit/51d016750e704b27ab8ace23c0f72acabca67018
https://github.com/rizinorg/rz-libdemangle/pull/54
https://github.com/rizinorg/rizin/pull/3753

Comment 1 Mauro Matteo Cascella 2023-08-27 10:18:01 UTC
Created rizin tracking bugs for this issue:

Affects: epel-8 [bug 2235164]
Affects: fedora-38 [bug 2235165]