GHSA-hc3c-63hc-2r9f: libcrux Potential Panic On Overlong Ciphertext Vulnerability

HIGH
CWE-120
Published
Advisory Summary

GHSA-hc3c-63hc-2r9f is a HIGH potential panic on overlong ciphertext vulnerability (CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')) affecting libcrux libraries in the crates.io ecosystem. The issue involves potential panic on overlong ciphertext buffer. Remediation is available by upgrading affected packages to version 0.0.8.

GHSA-hc3c-63hc-2r9f at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-hc3c-63hc-2r9f
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Affected Product libcrux
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-hc3c-63hc-2r9f

To remediate this vulnerability, upgrade all affected libcrux dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

libcrux-chacha20poly1305 fixed: 0.0.8
Upgrade libcrux-chacha20poly1305 to 0.0.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for libcrux-chacha20poly1305

How to Check if You Are Affected

To determine whether your application is affected by GHSA-hc3c-63hc-2r9f, inspect your project dependencies for libcrux:

inspect dependencies for libcrux-chacha20poly1305

Analyze the terminal output to locate any version of libcrux in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.8), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow'), where the product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. In libcrux, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

An application that passes in a ciphertext buffer of length greater than `ptxt.len() + TAG_LEN` to `libcrux_chacha20poly1305::encrypt` or `libcrux_chacha20poly1305::xchacha20_poly1305::encrypt` would experience a panic. ## Impact An application where the length of the ciphertext buffer is under attacker control could be made to crash. ## Mitigation The fix makes it so that `libcrux_chacha20poly1305::encrypt` and `libcrux_chacha20poly1305::xchacha20_poly1305::encrypt` no longer panic in this case, but instead write out the ciphertext and tag into the first `ptxt.len() + TAG_LEN` bytes of the provided buffer.

GHSA-hc3c-63hc-2r9f Affected libcrux Versions

1 component(s)
Fixed Versions:
0.0.8
Product / Package Ecosystem Affected Versions Fixed Version
libcrux-chacha20poly1305
crates.io
< 0.0.8
0.0.8

References

Frequently Asked Questions

What is GHSA-hc3c-63hc-2r9f?
GHSA-hc3c-63hc-2r9f is a security vulnerability in libcrux involving Potential Panic on Overlong Ciphertext Buffer under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow').
Which libcrux versions are affected?
Affected versions include releases prior to 0.0.8 across affected packages: libcrux-chacha20poly1305.
What version fixes GHSA-hc3c-63hc-2r9f?
Upgrading to 0.0.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is libcrux-chacha20poly1305 affected?
Yes, libcrux-chacha20poly1305 is affected in releases prior to 0.0.8. Upgrade your dependency to 0.0.8 or later.
What CWE is associated with GHSA-hc3c-63hc-2r9f?
GHSA-hc3c-63hc-2r9f is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') (The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer.).
How can I check crates.io dependencies for GHSA-hc3c-63hc-2r9f?
Run the dependency tree command: 'inspect dependencies for libcrux-chacha20poly1305'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hc3c-63hc-2r9f",
  "modified" : "2026-05-19T16:18:33Z",
  "published" : "2026-05-19T16:18:33Z",
  "aliases" : [ ],
  "summary" : "libcrux: Potential Panic on Overlong Ciphertext Buffer",
  "details" : "An application that passes in a ciphertext buffer of length greater\nthan `ptxt.len() + TAG_LEN` to `libcrux_chacha20poly1305::encrypt` or\n`libcrux_chacha20poly1305::xchacha20_poly1305::encrypt` would\nexperience a panic.\n\n## Impact\nAn application where the length of the ciphertext buffer is under\nattacker control could be made to crash.\n\n## Mitigation\nThe fix makes it so that `libcrux_chacha20poly1305::encrypt` and\n`libcrux_chacha20poly1305::xchacha20_poly1305::encrypt` no longer\npanic in this case, but instead write out the ciphertext and tag into\nthe first `ptxt.len() + TAG_LEN` bytes of the provided buffer.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "libcrux-chacha20poly1305"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cryspen/libcrux/pull/1386"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cryspen/libcrux"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2026-0124.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-120" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-19T16:18:33Z",
    "nvd_published_at" : null
  }
}