rustsec-2026-0212
Vulnerability from osv_rustsec
Published
2026-05-26 12:00
Modified
2026-07-17 11:34
Summary
Potentially Incorrect Output of Constant-Time Swap/Select on Aarch64
Details

The implementation of constant-time swap and select on aarch64 platforms used a cmp instruction in inline assembly to check whether an 8-bit wide selector was 0. The cmp instruction works on 32-bit registers, which included the unspecified high 24 bits of the cmp operand. Depending on the execution environment the cmp could thus potentially return an incorrect result because its operand's high bits in the inline assembly were set when Rust expected them to be unset. This could lead to incorrect results for the constant-time swap and select operations built from this comparison.

Impact

In certain circumstances the swap and select instructions on aarch64 platforms returned incorrect results.

Mitigation

Starting from version 0.0.6, the selector is compared using a tst instruction with a mask, which only compares the first 8 bits of the selector.


{
  "affected": [
    {
      "database_specific": {
        "categories": [],
        "cvss": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N",
        "informational": null
      },
      "ecosystem_specific": {
        "affected_functions": null,
        "affects": {
          "arch": [],
          "functions": [
            "libcrux_secrets::Select::select",
            "libcrux_secrets::Swap::swap"
          ],
          "os": []
        }
      },
      "package": {
        "ecosystem": "crates.io",
        "name": "libcrux-secrets",
        "purl": "pkg:cargo/libcrux-secrets"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0-0"
            },
            {
              "fixed": "0.0.6"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": []
    }
  ],
  "aliases": [],
  "database_specific": {
    "license": "CC0-1.0"
  },
  "details": "The implementation of constant-time swap and select on aarch64\nplatforms used a `cmp` instruction in inline assembly to check whether\nan 8-bit wide selector was 0. The `cmp` instruction works on 32-bit\nregisters, which included the unspecified high 24 bits of the `cmp` operand.\nDepending on the execution environment the `cmp`\ncould thus potentially return an incorrect result because its\noperand\u0027s high bits in the inline assembly were set when Rust expected them to be unset.\nThis could lead to incorrect results for the constant-time swap and select\noperations built from this comparison.\n\n## Impact\nIn certain circumstances the swap and select instructions on aarch64\nplatforms returned incorrect results.\n\n## Mitigation\nStarting from version `0.0.6`, the selector is compared using a `tst`\ninstruction with a mask, which only compares the first 8 bits of the\nselector.",
  "id": "RUSTSEC-2026-0212",
  "modified": "2026-07-17T11:34:24Z",
  "published": "2026-05-26T12:00:00Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://crates.io/crates/libcrux-secrets"
    },
    {
      "type": "ADVISORY",
      "url": "https://rustsec.org/advisories/RUSTSEC-2026-0212.html"
    },
    {
      "type": "WEB",
      "url": "https://github.com/celabshq/libcrux/pull/1461"
    }
  ],
  "related": [],
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Potentially Incorrect Output of Constant-Time Swap/Select on Aarch64"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

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.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…