UBUNTU-CVE-2021-42574 (CVE-2021-42574)

Vulnerability from osv_ubuntu – Published: 2021-11-01 04:15 – Updated: 2026-11-24 09:45 – Source website
VLAI
Details

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.

Upstream
Impacted products
Ecosystem Package Version
Ubuntu:20.04:LTS rustc
pkg:deb/ubuntu/rustc@1.57.0+dfsg1+llvm-0ubuntu1~20.04.1?arch=source&distro=focal
Affected: < 1.57.0+dfsg1+llvm-0ubuntu1~20.04.1 (ecosystem)
1.37.0+dfsg1+llvm-1ubuntu11.38.0+dfsg0.2+llvm-0ubuntu11.38.0+dfsg0.2+llvm-0ubuntu21.39.0+dfsg1+llvm-3ubuntu11.40.0+dfsg1+llvm-5ubuntu11.41.0+dfsg1+llvm-0ubuntu11.41.0+dfsg1+llvm-0ubuntu21.43.0+dfsg1+llvm-1~exp1ubuntu1~20.04.11.47.0+dfsg1+llvm-1ubuntu1~20.04.11.51.0+dfsg1+llvm-1~exp3ubuntu1~20.04.2 and 1 more (see JSON)
Ubuntu:22.04:LTS rustc
pkg:deb/ubuntu/rustc@1.57.0+dfsg1+llvm-0ubuntu2?arch=source&distro=jammy
Affected: < 1.57.0+dfsg1+llvm-0ubuntu2 (ecosystem)
1.51.0+dfsg1+llvm-1~exp3ubuntu11.53.0+dfsg1+llvm-4ubuntu11.54.0+dfsg2+llvm-3ubuntu11.56.0+dfsg1+llvm-2ubuntu11.56.0+dfsg1+llvm-2ubuntu21.57.0+dfsg1+llvm-0ubuntu1

{
  "affected": [
    {
      "ecosystem_specific": {
        "availability": "No subscription required",
        "binaries": [
          {
            "binary_name": "libstd-rust-1.57",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu1~20.04.1"
          },
          {
            "binary_name": "rust-all",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu1~20.04.1"
          },
          {
            "binary_name": "rust-clippy",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu1~20.04.1"
          },
          {
            "binary_name": "rust-gdb",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu1~20.04.1"
          },
          {
            "binary_name": "rust-lldb",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu1~20.04.1"
          },
          {
            "binary_name": "rust-src",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu1~20.04.1"
          },
          {
            "binary_name": "rustc",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu1~20.04.1"
          },
          {
            "binary_name": "rustfmt",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu1~20.04.1"
          }
        ]
      },
      "package": {
        "ecosystem": "Ubuntu:20.04:LTS",
        "name": "rustc",
        "purl": "pkg:deb/ubuntu/rustc@1.57.0+dfsg1+llvm-0ubuntu1~20.04.1?arch=source\u0026distro=focal"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.57.0+dfsg1+llvm-0ubuntu1~20.04.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "1.37.0+dfsg1+llvm-1ubuntu1",
        "1.38.0+dfsg0.2+llvm-0ubuntu1",
        "1.38.0+dfsg0.2+llvm-0ubuntu2",
        "1.39.0+dfsg1+llvm-3ubuntu1",
        "1.40.0+dfsg1+llvm-5ubuntu1",
        "1.41.0+dfsg1+llvm-0ubuntu1",
        "1.41.0+dfsg1+llvm-0ubuntu2",
        "1.43.0+dfsg1+llvm-1~exp1ubuntu1~20.04.1",
        "1.47.0+dfsg1+llvm-1ubuntu1~20.04.1",
        "1.51.0+dfsg1+llvm-1~exp3ubuntu1~20.04.2",
        "1.53.0+dfsg1+llvm-4ubuntu1~20.04.1"
      ]
    },
    {
      "ecosystem_specific": {
        "availability": "No subscription required",
        "binaries": [
          {
            "binary_name": "libstd-rust-1.57",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu2"
          },
          {
            "binary_name": "rust-all",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu2"
          },
          {
            "binary_name": "rust-clippy",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu2"
          },
          {
            "binary_name": "rust-gdb",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu2"
          },
          {
            "binary_name": "rust-lldb",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu2"
          },
          {
            "binary_name": "rust-src",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu2"
          },
          {
            "binary_name": "rustc",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu2"
          },
          {
            "binary_name": "rustfmt",
            "binary_version": "1.57.0+dfsg1+llvm-0ubuntu2"
          }
        ]
      },
      "package": {
        "ecosystem": "Ubuntu:22.04:LTS",
        "name": "rustc",
        "purl": "pkg:deb/ubuntu/rustc@1.57.0+dfsg1+llvm-0ubuntu2?arch=source\u0026distro=jammy"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.57.0+dfsg1+llvm-0ubuntu2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "1.51.0+dfsg1+llvm-1~exp3ubuntu1",
        "1.53.0+dfsg1+llvm-4ubuntu1",
        "1.54.0+dfsg2+llvm-3ubuntu1",
        "1.56.0+dfsg1+llvm-2ubuntu1",
        "1.56.0+dfsg1+llvm-2ubuntu2",
        "1.57.0+dfsg1+llvm-0ubuntu1"
      ]
    }
  ],
  "aliases": [],
  "details": "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.",
  "id": "UBUNTU-CVE-2021-42574",
  "modified": "2026-11-24T09:45:23Z",
  "published": "2021-11-01T04:15:00Z",
  "references": [
    {
      "type": "REPORT",
      "url": "https://ubuntu.com/security/CVE-2021-42574"
    },
    {
      "type": "REPORT",
      "url": "https://www.openwall.com/lists/oss-security/2021/11/01/1"
    },
    {
      "type": "REPORT",
      "url": "https://github.com/rust-lang/rust/commit/dd61274930ec0cd17711fab52d2bc9ad3e9053de"
    },
    {
      "type": "REPORT",
      "url": "https://trojansource.codes"
    },
    {
      "type": "REPORT",
      "url": "http://www.unicode.org/versions/Unicode14.0.0/"
    },
    {
      "type": "REPORT",
      "url": "https://www.cve.org/CVERecord?id=CVE-2021-42574"
    }
  ],
  "related": [],
  "schema_version": "1.9.2",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H",
      "source": "NVD",
      "type": "CVSS_V3"
    },
    {
      "score": "medium",
      "source": "SELF",
      "type": "Ubuntu"
    }
  ],
  "upstream": [
    "CVE-2021-42574"
  ]
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.