{"id":"GHSA-hc3c-63hc-2r9f","aliases":["RUSTSEC-2026-0124"],"status":"published","title":"libcrux: Potential Panic on Overlong Ciphertext Buffer","description":"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":{"version":"4.0","score":8.2,"vector":"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","level":"high","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-120"],"published":"2026-03-29T12:00:00Z","modified":"2026-05-20T07:26:23Z","fixes":[{"ecosystem":"crates.io","package":"libcrux-chacha20poly1305","fixed_in":["0.0.8"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"libcrux-chacha20poly1305","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.8"}]}]},{"source":"osv","ecosystem":"crates.io","package":"libcrux-chacha20poly1305","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.0.8"}]}]},{"source":"osv","ecosystem":"crates.io","package":"libcrux-chacha20poly1305","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.0.8"}]}]}],"references":[{"url":"https://github.com/cryspen/libcrux/pull/1386","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0124.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-hc3c-63hc-2r9f"},{"url":"https://github.com/cryspen/libcrux","tags":["package"]},{"url":"https://crates.io/crates/libcrux-chacha20poly1305","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-hc3c-63hc-2r9f","title":"libcrux: Potential Panic on Overlong Ciphertext Buffer","description":"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.","status":"published","published":"2026-05-19T16:18:33Z","modified":"2026-05-19T16:18:36Z","cvss":[{"version":"4.0","score":8.2,"vector":"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","level":"high"}],"cwes":["CWE-120"],"updated_at":"2026-11-02T14:40:12.430932Z"}],"osv":[{"id":"GHSA-hc3c-63hc-2r9f","title":"libcrux: Potential Panic on Overlong Ciphertext Buffer","description":"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.","status":"published","published":"2026-05-19T16:18:33Z","modified":"2026-05-20T07:26:23.649057951Z","cvss":[{"version":"4.0","score":8.2,"vector":"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","level":"high"}],"cwes":["CWE-120"],"updated_at":"2026-11-02T15:46:48.920784Z"},{"id":"RUSTSEC-2026-0124","title":"Potential Panic on Overlong Ciphertext Buffer","description":"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.","status":"published","published":"2026-03-29T12:00:00Z","modified":"2026-05-20T07:15:03.934256757Z","cvss":[{"version":"4.0","score":8.2,"vector":"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","level":"high"}],"updated_at":"2026-11-02T15:53:40.430679Z"}]}}
