CVE-2019-18224
📋 TL;DR
CVE-2019-18224 is a critical heap-based buffer overflow vulnerability in GNU libidn2's idn2_to_ascii_4i function. Attackers can exploit this by providing a specially crafted long domain string, potentially leading to remote code execution or denial of service. This affects any system or application using vulnerable versions of libidn2 for Internationalized Domain Name processing.
💻 Affected Systems
- GNU libidn2
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution with full system compromise, allowing attackers to execute arbitrary code with the privileges of the vulnerable process.
Likely Case
Denial of service through application crashes or system instability, potentially leading to service disruption.
If Mitigated
Limited impact if proper memory protection mechanisms (ASLR, DEP) are in place, though crashes may still occur.
🎯 Exploit Status
The vulnerability is triggered by simple long domain strings, making exploitation straightforward. Public proof-of-concept exists in the OSS-Fuzz bug report.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.1.1
Vendor Advisory: https://github.com/libidn/libidn2/commit/e4d1558aa2c1c04a05066ee8600f37603890ba8c
Restart Required: Yes
Instructions:
1. Update libidn2 to version 2.1.1 or later using your distribution's package manager. 2. For source installations: download from https://ftp.gnu.org/gnu/libidn/ and compile. 3. Restart affected services or applications using libidn2.
🔧 Temporary Workarounds
Input validation
allImplement strict length validation for domain names before passing to libidn2 functions.
🧯 If You Can't Patch
- Implement network filtering to block unusually long domain names at perimeter devices.
- Use application-level input validation to reject domain names exceeding reasonable length limits.
🔍 How to Verify
Check if Vulnerable:
Check libidn2 version: `ldconfig -p | grep libidn2` and compare with version 2.1.1.
Check Version:
pkg-config --modversion libidn2 2>/dev/null || ldconfig -p | grep libidn2
Verify Fix Applied:
Verify installed version is 2.1.1 or higher: `pkg-config --modversion libidn2` or check package manager.
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults
- Memory corruption errors in system logs
- Unusual process termination
Network Indicators:
- Requests with unusually long domain names
- DNS queries with excessive length
SIEM Query:
source="*syslog*" AND ("segmentation fault" OR "buffer overflow") AND process="*libidn2*"
🔗 References
- http://lists.opensuse.org/opensuse-security-announce/2019-12/msg00008.html
- http://lists.opensuse.org/opensuse-security-announce/2019-12/msg00009.html
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12420
- https://github.com/libidn/libidn2/commit/e4d1558aa2c1c04a05066ee8600f37603890ba8c
- https://github.com/libidn/libidn2/compare/libidn2-2.1.0...libidn2-2.1.1
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JDQVQ2XPV5BTZUFINT7AFJSKNNBVURNJ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MINU5RKDFE6TKAFY5DRFN3WSFDS4DYVS/
- https://seclists.org/bugtraq/2020/Feb/4
- https://security.gentoo.org/glsa/202003-63
- https://usn.ubuntu.com/4168-1/
- https://www.debian.org/security/2020/dsa-4613
- http://lists.opensuse.org/opensuse-security-announce/2019-12/msg00008.html
- http://lists.opensuse.org/opensuse-security-announce/2019-12/msg00009.html
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12420
- https://github.com/libidn/libidn2/commit/e4d1558aa2c1c04a05066ee8600f37603890ba8c
- https://github.com/libidn/libidn2/compare/libidn2-2.1.0...libidn2-2.1.1
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JDQVQ2XPV5BTZUFINT7AFJSKNNBVURNJ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MINU5RKDFE6TKAFY5DRFN3WSFDS4DYVS/
- https://seclists.org/bugtraq/2020/Feb/4
- https://security.gentoo.org/glsa/202003-63
- https://usn.ubuntu.com/4168-1/
- https://www.debian.org/security/2020/dsa-4613