Bug 2005819 (CVE-2021-42574)

Summary: CVE-2021-42574 Developer environment: Unicode's bidirectional (BiDi) override characters can cause trojan source attacks
Product: [Other] Security Response Reporter: Huzaifa S. Sidhpurwala <huzaifas>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: aboyko, adinn, ahajkova, ahenning, ahughes, ailan, akashche, aoliva, asm, atangrin, bdettelb, bodavis, brasmith, caswilli, crarobin, danken, daoneill, dbaker, dbenoit, deparker, dhughes, dkuc, dmalcolm, dvlasenk, eduen, eglynn, emachado, ericwill, fche, fjansen, fweimer, hhorak, jakub, janstey, jary, jason, jchecahi, jeischma, jgrulich, jistone, jjoyce, jkang, jmadigan, jmaury, jmigacz, jmitchel, jnakfour, jorton, jpadman, jplesnik, jvanek, jwakely, jwboyer, jwendell, jwong, kaycoth, kdudka, keiths, kejohnso, kwall, law, lmadsen, lsharar, mbalao, mbenitez, mburns, mcermak, mclasen, mcressma, midawson, mkleinhe, mlittle, mloriedo, mmuzila, mnewsome, mpolacek, mprchlik, mrunge, msebor, mskarbek, nboldt, neugens, ngough, nickc, ohudlick, omajid, opohorel, pamccart, parichar, pleimer, pmatilai, psegedy, pskopek, pviktori, python-maint, rcernich, rich.sharples, rmonk, rstrode, sbiarozk, sbouchet, security-response-team, sgehwolf, sguelton, sguilhen, sipoyare, sthirugn, tcarlin, tschelle, tstellar, tsweeney, virt-maint, vkadlcik, vmugicag, vondruch, yjog, zdohnal
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the way Unicode standards are implemented in the context of development environments, which have specialized requirements for rendering text. An attacker could exploit this to deceive a human reviewer by creating a malicious patch containing well placed BiDi characters. The special handling and rendering of those characters can be then used in an attempt to hide unexpected and potentially dangerous behaviour from the reviewer.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-01 08:07:51 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: 2009282, 2009283, 2009285, 2008380, 2008381, 2008382, 2008383, 2008384, 2008385, 2008388, 2008389, 2008390, 2008391, 2008392, 2008393, 2009163, 2009164, 2009165, 2009166, 2009167, 2009168, 2009169, 2009170, 2009171, 2009172, 2009173, 2009174, 2009175, 2009176, 2009177, 2009178, 2009179, 2009180, 2009181, 2009182, 2009183, 2009184, 2009185, 2009186, 2009187, 2009188, 2009190, 2009195, 2009247, 2009248, 2009249, 2009250, 2009251, 2009252, 2009259, 2009260, 2009261, 2009262, 2009263, 2009272, 2009273, 2009274, 2009275, 2009276, 2009277, 2009284, 2009286, 2009287, 2011665, 2016236, 2016237, 2016238, 2016239, 2016240, 2016241, 2016242, 2016243, 2016244, 2016245, 2017359, 2017360, 2017361, 2017362, 2017363, 2017364, 2017365, 2017366, 2017367, 2017368, 2017779, 2017780, 2017781, 2017782, 2017783, 2017816, 2017817, 2017818, 2017819, 2017820, 2018682, 2018683, 2018684, 2018685, 2018686, 2018687, 2018848, 2018849, 2018850, 2018860, 2019361, 2023658, 2023676    
Bug Blocks: 2002822    

Description Huzaifa S. Sidhpurwala 2021-09-20 09:19:11 UTC
A flaw was found in the way Unicode standards are implemented in the context of development environments, which have specialized requirements for rendering text. An attacker could exploit this to deceive a human reviewer by creating a malicious patch containing well-placed BiDi characters. The special handling and rendering of those characters can be then used in an attempt to hide unexpected and potentially dangerous behavior from the reviewer.

Unicode’s Directional Formatting Characters (‘BiDi’) are invisible characters that switch the display ordering of one or more characters. BiDi overrides cause characters to display in a different order from that in which they are written.

Comment 171 Huzaifa S. Sidhpurwala 2021-11-01 00:33:26 UTC
Created annobin tracking bugs for this issue:

Affects: fedora-all [bug 2018850]


Created binutils tracking bugs for this issue:

Affects: fedora-all [bug 2018848]


Created gcc tracking bugs for this issue:

Affects: fedora-all [bug 2018849]

Comment 173 errata-xmlrpc 2021-11-01 07:41:56 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.3 Advanced Update Support

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

Comment 174 errata-xmlrpc 2021-11-01 07:42:21 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.2 Advanced Update Support

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

Comment 175 errata-xmlrpc 2021-11-01 07:44:19 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.4 Advanced Update Support

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

Comment 176 errata-xmlrpc 2021-11-01 07:54:32 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

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

Comment 177 errata-xmlrpc 2021-11-01 07:56:33 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.6 Advanced Update Support
  Red Hat Enterprise Linux 7.6 Update Services for SAP Solutions
  Red Hat Enterprise Linux 7.6 Telco Extended Update Support

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

Comment 178 errata-xmlrpc 2021-11-01 08:03:05 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.7 Advanced Update Support
  Red Hat Enterprise Linux 7.7 Update Services for SAP Solutions
  Red Hat Enterprise Linux 7.7 Telco Extended Update Support

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

Comment 179 Product Security DevOps Team 2021-11-01 08:07:51 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2021-42574

Comment 180 errata-xmlrpc 2021-11-01 08:11:33 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 181 Dave Malcolm 2021-11-01 14:22:37 UTC
I've posted a script "utf8-dump.py" to upstream GCC:
  https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583024.html
to make it easier to grok encoding issues in source files, and, in particular, the difference between visual and logical order in bidirectional files.

I've committed this patch to upstream GCC (for GCC 12):
  https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583020.html
    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=bd5e882cf6e0def3dd1bc106075d59a303fe0d1e
which improves the UX for diagnostics involving Unicode encoding issues (but this patch does *not* itself directly detect them).  Unfortunately it's nontrivial to backport to earlier GCC releases.

Comment 182 Dave Malcolm 2021-11-01 15:10:46 UTC
Upstream GCC bugs:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103026 ("Implement warning for Unicode bidi override characters [CVE-2021-42574]")
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103027 ("Implement warning for homoglyphs in identifiers [CVE-2021-42694]")

Comment 184 errata-xmlrpc 2021-11-10 08:59:13 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.4 Extended Update Support

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

Comment 185 errata-xmlrpc 2021-11-10 09:02:46 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 186 errata-xmlrpc 2021-11-10 09:10:37 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.4 Extended Update Support

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

Comment 187 errata-xmlrpc 2021-11-10 09:12:39 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.1 Extended Update Support

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

Comment 188 errata-xmlrpc 2021-11-10 09:18:26 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 189 errata-xmlrpc 2021-11-10 09:35:32 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.2 Extended Update Support

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

Comment 190 errata-xmlrpc 2021-11-10 09:43:59 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 191 errata-xmlrpc 2021-11-10 09:44:27 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 192 errata-xmlrpc 2021-11-10 09:45:00 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 193 errata-xmlrpc 2021-11-10 09:45:12 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.2 Extended Update Support

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

Comment 194 errata-xmlrpc 2021-11-10 09:46:14 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 195 errata-xmlrpc 2021-11-10 09:52:36 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 196 errata-xmlrpc 2021-11-10 09:52:52 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 197 errata-xmlrpc 2021-11-10 09:55:05 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.1 Extended Update Support

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

Comment 198 errata-xmlrpc 2021-11-10 10:21:21 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.4 Extended Update Support

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

Comment 199 errata-xmlrpc 2021-11-10 10:37:58 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.4 Extended Update Support

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

Comment 200 errata-xmlrpc 2021-11-10 11:01:36 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 201 errata-xmlrpc 2021-11-15 10:25:54 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 202 errata-xmlrpc 2021-11-15 11:47:42 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

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

Comment 205 errata-xmlrpc 2021-11-16 11:32:32 UTC
This issue has been addressed in the following products:

  Red Hat Developer Tools

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

Comment 206 errata-xmlrpc 2021-11-17 16:17:47 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

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

Comment 207 errata-xmlrpc 2021-11-17 16:55:34 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

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

Comment 208 errata-xmlrpc 2021-11-18 10:01:42 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

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

Comment 209 errata-xmlrpc 2021-11-18 10:06:19 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

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

Comment 210 errata-xmlrpc 2021-11-18 17:44:08 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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