Bug 1764780 (CVE-2019-18224)

Summary: CVE-2019-18224 libidn2: heap-based buffer overflow in idn2_to_ascii_4i in lib/lookup.c
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: mlichvar, redhat-bugzilla, vladimir.khmyrov
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libidn2 2.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-25 22:12:30 UTC 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: 1674201, 1764781, 1764782, 1764783, 1764784, 1768392    
Bug Blocks: 1764786    

Description Guilherme de Almeida Suckevicz 2019-10-23 17:40:34 UTC
idn2_to_ascii_4i in lib/lookup.c in GNU libidn2 before 2.1.1 has a heap-based buffer overflow via a long domain string.

Reference:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12420

Upstream commit:
https://github.com/libidn/libidn2/commit/e4d1558aa2c1c04a05066ee8600f37603890ba8c

Comment 1 Guilherme de Almeida Suckevicz 2019-10-23 17:40:55 UTC
Created libidn2 tracking bugs for this issue:

Affects: epel-all [bug 1764782]
Affects: fedora-all [bug 1764781]


Created mingw-libidn2 tracking bugs for this issue:

Affects: epel-7 [bug 1764784]
Affects: fedora-all [bug 1764783]

Comment 2 Robert Scheck 2019-10-23 17:47:59 UTC
Is there a specific reason for bug #1764781 and bug #1764782, as libidn2-2.2.0-1 (or later) is shipped on all Fedora and EPEL branches for months now…

Comment 3 Guilherme de Almeida Suckevicz 2019-10-23 18:33:40 UTC
(In reply to Robert Scheck from comment #2)
> Is there a specific reason for bug #1764781 and bug #1764782, as
> libidn2-2.2.0-1 (or later) is shipped on all Fedora and EPEL branches for
> months now…

Hi Robert,

You can close the bug #1764781 and bug #1764782 since it's not affected.

Comment 4 Huzaifa S. Sidhpurwala 2019-11-04 10:12:00 UTC
Analysis:

This is essentially an overflow in the idn2_to_ascii_4i() function which converts zero terminated input Unicode (UCS-4) string. to ASCII strings and can be triggered with a very long input strings. 
Note: This function is however deprecated in newer versions of the library and replaced by: idn2_to_ascii_4i2()