cve.bz

CVE-2021-42574 (Trojan Source) Code Injection

8.3 highExploit referenceEPSS 13%

Known as Trojan Source

High (8.3). EPSS 13% estimated probability of exploitation activity in the next 30 days.

On this page
An issue was discovered in the Bidirectional Algorithm in the Unicode Specification through 14.0. It permits the visual reordering of characters via control sequences, which can be used to craft source code that renders different logic than the logical ordering of tokens ingested by compilers and interpreters. Adversaries can leverage this to encode source code for compilers accepting Unicode such that targeted vulnerabilities are introduced invisibly to human reviewers. NOTE: the Unicode Consortium offers the following alternative approach to presenting this concern. An issue is noted in the nature of international text that can affect applications that implement support for The Unicode Standard and the Unicode Bidirectional Algorithm (all versions). Due to text display behavior when text includes left-to-right and right-to-left characters, the visual order of tokens may be different from their logical order. Additionally, control characters needed to fully support the requirements of bidirectional text can further obfuscate the logical order of tokens. Unless mitigated, an adversary could craft source code such that the ordering of tokens perceived by human reviewers does not match what will be processed by a compiler/interpreter/etc. The Unicode Consortium has documented this class of vulnerability in its document, Unicode Technical Report #36, Unicode Security Considerations. The Unicode Consortium also provides guidance on mitigations for this class of issues in Unicode Technical Standard #39, Unicode Security Mechanisms, and in Unicode Standard Annex #31, Unicode Identifier and Pattern Syntax. Also, the BIDI specification allows applications to tailor the implementation in ways that can mitigate misleading visual reordering in program text; see HL4 in Unicode Standard Annex #9, Unicode Bidirectional Algorithm.

Severity

CVSS 3.1

8.3 high
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
EPSS
13% (unchanged from 13% a week ago; 13% 30 days ago) estimated probability of exploitation activity in the next 30 days; 96th percentile. Scored 2026-11-21. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: total, assessed 2024-06-11. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-94 Improper Control of Generation of Code (Code Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-42574 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-42574?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-42574?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-42574 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
unicode:unicodebefore 14.0.0
fedoraproject:fedora33
fedoraproject:fedora34
fedoraproject:fedora35
starwindsoftware:starwind_virtual_sanv8r13:14398

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14rustc1.57.0+dfsg1-1DEBIAN-CVE-2021-42574
Ubuntu20.04:LTSrustc1.57.0+dfsg1+llvm-0ubuntu1~20.04.1UBUNTU-CVE-2021-42574
Ubuntu22.04:LTSrustc1.57.0+dfsg1+llvm-0ubuntu2UBUNTU-CVE-2021-42574
Red Hatdevtools:2021rust-toolset-1.54-rls, rust-toolset-1.54-rust, rust-toolset-1.54-cargo and 11 more0:1.54.0-4.el7_9RHSA-2021:4694
Red Hatenterprise_linux:7::client, enterprise_linux:7::server, enterprise_linux:7::workstationbinutils, binutils-devel, binutils-debuginfo0:2.27-44.base.el7_9.1RHSA-2021:4033
Red Hatenterprise_linux:7::computenodebinutils-devel, binutils-debuginfo0:2.27-44.base.el7_9.1RHSA-2021:4033
Red Hatenterprise_linux:8::appstreamannobin, annobin-annocheck, annobin-debuginfo and 2 more0:9.72-1.el8_5.2RHSA-2021:4593
Red Hatenterprise_linux:8::appstreambinutils-devel, binutils-debuginfo, binutils-debugsource0:2.30-108.el8_5.1RHSA-2021:4595
Red Hatenterprise_linux:8::appstreamclang, clang-libs, clang-devel and 9 more0:12.0.1-4.module+el8.5.0+13246+cefb5d4cRHSA-2021:4743
Red Hatenterprise_linux:8::appstreamcpp, gcc, gcc-c++ and 27 more0:8.5.0-4.el8_5RHSA-2021:4587
Red Hatenterprise_linux:8::appstreamgcc-toolset-10-annobin, gcc-toolset-10-annobin-debuginfo, gcc-toolset-10-annobin-annocheck-debuginfo0:9.29-1.el8_5.2RHSA-2021:4592
Red Hatenterprise_linux:8::appstreamgcc-toolset-10-binutils, gcc-toolset-10-binutils-devel, gcc-toolset-10-binutils-debuginfo0:2.35-8.el8_5.6RHSA-2021:4649
Red Hatenterprise_linux:8::appstreamgcc-toolset-11-annobin, gcc-toolset-11-annobin-docs, gcc-toolset-11-annobin-annocheck and 4 more0:9.85-1.el8_5.1RHSA-2021:4591
Red Hatenterprise_linux:8::appstreamgcc-toolset-11-binutils, gcc-toolset-11-binutils-devel, gcc-toolset-11-binutils-debuginfo0:2.36.1-1.el8_5.1RHSA-2021:4594
Red Hatenterprise_linux:8::appstreamlibasan6, gcc-toolset-10-gcc, libasan6-debuginfo and 19 more0:10.3.1-1.2.el8_5RHSA-2021:4585
31 more for Red Hat in the JSON and on Red Hat's page.
openSUSETumbleweedrust1.561.56.1-1.1openSUSE-SU-2024:11650-1
AlmaLinux8annobin, annobin-annocheck9.72-1.el8_5.2ALSA-2021:4593
AlmaLinux8binutils-devel2.30-108.el8_5.1ALSA-2021:4595
AlmaLinux8clang, clang-libs, clang-devel and 5 more12.0.1-4.module_el8.4.0+2600+cefb5d4cALSA-2021:4743
AlmaLinux8cpp, gcc, gcc-c++ and 9 more8.5.0-4.el8_5.almaALSA-2021:4587
AlmaLinux8gcc-toolset-10-annobin9.29-1.el8_5.2ALSA-2021:4592
AlmaLinux8gcc-toolset-10-binutils, gcc-toolset-10-binutils-devel2.35-8.el8_5.6ALSA-2021:4649
AlmaLinux8gcc-toolset-11-annobin-docs, gcc-toolset-11-annobin-annocheck, gcc-toolset-11-annobin-plugin-gcc9.85-1.el8_5.1ALSA-2021:4591
AlmaLinux8gcc-toolset-11-binutils, gcc-toolset-11-binutils-devel2.36.1-1.el8_5.1ALSA-2021:4594
AlmaLinux8libasan6, gcc-toolset-10-gcc, gcc-toolset-10-gcc-c++ and 12 more10.3.1-1.2.el8_5ALSA-2021:4585
AlmaLinux8libasan6, gcc-toolset-11-gcc, gcc-toolset-11-gcc-c++ and 15 more11.2.1-1.2.el8_5ALSA-2021:4586
AlmaLinux8lld, lldb, libomp and 10 more12.0.1-1.module_el8.4.0+2600+cefb5d4cALSA-2021:4743
AlmaLinux8llvm, llvm-doc, llvm-libs and 4 more12.0.1-2.module_el8.4.0+2600+cefb5d4cALSA-2021:4743
2 more for AlmaLinux in the JSON.
Rocky Linux8annobin0:9.72-1.el8_5.2RLSA-2021:4593
Rocky Linux8binutils0:2.30-108.el8_5.1RLSA-2021:4595
Rocky Linux8clang0:12.0.1-4.module+el8.5.0+715+58f51d49RLSA-2021:4743
Rocky Linux8gcc0:8.5.0-4.el8_5RLSA-2021:4587
Rocky Linux8gcc-toolset-10-annobin0:9.29-1.el8_5.2RLSA-2021:4592
Rocky Linux8gcc-toolset-10-binutils0:2.35-8.el8_5.6RLSA-2021:4649
Rocky Linux8gcc-toolset-10-gcc0:10.3.1-1.2.el8_5RLSA-2021:4585
Rocky Linux8gcc-toolset-11-annobin0:9.85-1.el8_5.1RLSA-2021:4591
Rocky Linux8gcc-toolset-11-binutils0:2.36.1-1.el8_5.1RLSA-2021:4594
Rocky Linux8gcc-toolset-11-gcc0:11.2.1-1.2.el8_5RLSA-2021:4586
Rocky Linux8lld, lldb, libomp and 3 more0:12.0.1-1.module+el8.5.0+692+8756646fRLSA-2021:4743
Rocky Linux8llvm0:12.0.1-2.module+el8.5.0+692+8756646fRLSA-2021:4743
2 more for Rocky Linux in the JSON.
Alpinev3.15, v3.16, v3.17 and 6 morerust1.56.1-r0ALPINE-CVE-2021-42574
Alpinev3.24rust, chromium-rust1.56.1-r0ALPINE-CVE-2021-42574

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This is a flaw with the way Unicode standards are implemented in the context of development environments, which have specialized requirements for rendering text. This is not a flaw in Red Hat products.

Red Hat's mitigation

This issue can be mitigated by ensuring code commits get a proper review. All new commits can also be scanned for the presence of BiDi characters before accepting the commit.

ProductPackageStateAdvisory
Red Hat Developer Toolsrust-toolset-1.54-rust-0:1.54.0-4.el7_9Fixed 2021-11-16RHSA-2021:4694
Red Hat Enterprise Linux 7binutils-0:2.27-44.base.el7_9.1Fixed 2021-11-01RHSA-2021:4033
Red Hat Enterprise Linux 7.2 Advanced Update Supportbinutils-0:2.23.52.0.1-55.el7_2.4Fixed 2021-11-01RHSA-2021:4038
Red Hat Enterprise Linux 7.3 Advanced Update Supportbinutils-0:2.25.1-22.base.el7_3.3Fixed 2021-11-01RHSA-2021:4037
Red Hat Enterprise Linux 7.4 Advanced Update Supportbinutils-0:2.25.1-32.base.el7_4.5Fixed 2021-11-01RHSA-2021:4036
Red Hat Enterprise Linux 7.6 Advanced Update Supportbinutils-0:2.27-34.base.el7_6.4Fixed 2021-11-01RHSA-2021:4035
Red Hat Enterprise Linux 7.6 Telco Extended Update Supportbinutils-0:2.27-34.base.el7_6.4Fixed 2021-11-01RHSA-2021:4035
Red Hat Enterprise Linux 7.6 Update Services for SAP Solutionsbinutils-0:2.27-34.base.el7_6.4Fixed 2021-11-01RHSA-2021:4035
Red Hat Enterprise Linux 7.7 Advanced Update Supportbinutils-0:2.27-41.base.el7_7.4Fixed 2021-11-01RHSA-2021:4034
Red Hat Enterprise Linux 7.7 Telco Extended Update Supportbinutils-0:2.27-41.base.el7_7.4Fixed 2021-11-01RHSA-2021:4034
Red Hat Enterprise Linux 7gccWill not fix
Red Hat Enterprise Linux 8gcc-toolset-9-annobinWill not fix
Red Hat Enterprise Linux 8gcc-toolset-9-binutilsWill not fix
Red Hat Enterprise Linux 8gcc-toolset-9-gccWill not fix
Red Hat Enterprise Linux 8go-toolset:rhel8/golangWill not fix
Red Hat Enterprise Linux 8mingw-binutilsWill not fix
Red Hat Enterprise Linux 9annobinNot affected
Red Hat Enterprise Linux 9binutilsNot affected
Red Hat Enterprise Linux 9clangNot affected
Red Hat Enterprise Linux 9gccNot affected
35 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-42574.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON