Bug 24973 (CVE-2019-25013) - iconv encounters segmentation fault when converting 0x00 0xfe in EUC-KR to UTF-8 (CVE-2019-25013)
Summary: iconv encounters segmentation fault when converting 0x00 0xfe in EUC-KR to UT...
Status: RESOLVED FIXED
Alias: CVE-2019-25013
Product: glibc
Classification: Unclassified
Component: locale (show other bugs)
Version: 2.30
: P2 normal
Target Milestone: 2.33
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-06 10:47 UTC by Arjun Shankar
Modified: 2021-01-04 19:59 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arjun Shankar 2019-09-06 10:47:28 UTC
The following equivalent iconv invocations lead to a SIGSEGV:

$ echo -en "\x00\xfe" | iconv -f EUC-KR -t "UTF-8//IGNORE"

$ echo -en "\x00\xfe" | iconv -c -f EUC-KR -t "UTF-8"
Comment 1 Siddhesh Poyarekar 2020-12-21 03:37:02 UTC
Fixed in master:

https://sourceware.org/git/?p=glibc.git;a=commit;h=ee7a3144c9922808181009b7b3e50e852fb4999b

Author: Andreas Schwab <schwab@suse.de>
Date:   Mon Dec 21 08:56:43 2020 +0530

    Fix buffer overrun in EUC-KR conversion module (bz #24973)
    
    The byte 0xfe as input to the EUC-KR conversion denotes a user-defined
    area and is not allowed.  The from_euc_kr function used to skip two bytes
    when told to skip over the unknown designation, potentially running over
    the buffer end.