{"id":"CVE-2024-58262","aliases":["DEBIAN-CVE-2024-58262","EUVD-2024-54823","GHSA-x4gp-pqpj-f43q","RUSTSEC-2024-0344"],"status":"published","title":"curve25519-dalek has timing variability in `curve25519-dalek`'s `Scalar29::sub`/`Scalar52::sub`","description":"The curve25519-dalek crate before 4.1.3 for Rust has a constant-time operation on elliptic curve scalars that is removed by LLVM.","severity":{"version":"3.1","score":2.9,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.0018,"percentile":0.07649,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-203","CWE-733"],"published":"2024-06-18T12:00:00Z","modified":"2026-11-02T12:03:12Z","fixes":[{"ecosystem":"crates.io","package":"curve25519-dalek","fixed_in":["4.1.3"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:13","package":"rust-curve25519-dalek","fixed_in":["4.1.3+20240618+dfsg-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"rust-curve25519-dalek","fixed_in":["4.1.3+20240618+dfsg-1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"curve25519-dalek","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.1.3"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"rust-curve25519-dalek","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.1.3+20240618+dfsg-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"rust-curve25519-dalek","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.1.3+20240618+dfsg-1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"curve25519-dalek","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.1.3"}]}]},{"source":"osv","ecosystem":"crates.io","package":"curve25519-dalek","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"4.1.3"}]}]}],"products":[{"vendor":"dalek","product":"curve25519-dalek"},{"vendor":"dalek-cryptography","product":"curve25519-dalek"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2024-0344.html","tags":["Third Party Advisory","advisory","web"]},{"url":"https://github.com/dalek-cryptography/curve25519-dalek/pull/659","tags":["Issue Tracking","Patch","fix","web"]},{"url":"https://crates.io/crates/curve25519-dalek","tags":["Product","web","package"]},{"url":"https://github.com/dalek-cryptography/curve25519-dalek/commit/415892acf1cdf9161bd6a4c99bc2f4cb8fae5e6a","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58262","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-x4gp-pqpj-f43q"},{"url":"https://security-tracker.debian.org/tracker/CVE-2024-58262","tags":["advisory"]},{"url":"https://github.com/dalek-cryptography/curve25519-dalek","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-58262","description":"The curve25519-dalek crate before 4.1.3 for Rust has a constant-time operation on elliptic curve scalars that is removed by LLVM.","status":"published","published":"2025-07-27T00:00:00Z","modified":"2025-07-28T18:55:22.149Z","cvss":[{"version":"3.1","score":2.9,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low","assessor":"cna"}],"cwes":["CWE-733"],"updated_at":"2026-11-02T14:34:08.843708Z"}],"euvd":[{"id":"EUVD-2024-54823","description":"The curve25519-dalek crate before 4.1.3 for Rust has a constant-time operation on elliptic curve scalars that is removed by LLVM.","status":"published","published":"2025-07-27T00:00:00Z","modified":"2025-07-28T18:55:22Z","cvss":[{"version":"3.1","score":2.9,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"updated_at":"2026-11-02T20:32:03.359865Z"}],"ghsa":[{"id":"GHSA-x4gp-pqpj-f43q","title":"curve25519-dalek has timing variability in `curve25519-dalek`'s `Scalar29::sub`/`Scalar52::sub`","description":"Timing variability of any kind is problematic when working with  potentially secret values such as elliptic curve scalars, and such issues can potentially leak private keys and other secrets. Such a problem was recently discovered in `curve25519-dalek`.\n\nThe `Scalar29::sub` (32-bit) and `Scalar52::sub` (64-bit) functions contained usage of a mask value inside a loop where LLVM saw an opportunity to insert a branch instruction (`jns` on x86) to conditionally bypass this code section when the mask value is set to zero as can be seen in godbolt:\n\n- 32-bit (see L106): https://godbolt.org/z/zvaWxzvqv\n- 64-bit (see L48): https://godbolt.org/z/PczYj7Pda\n\nA similar problem was recently discovered in the Kyber reference implementation:\n\nhttps://groups.google.com/a/list.nist.gov/g/pqc-forum/c/hqbtIGFKIpU/m/cnE3pbueBgAJ\n\nAs discussed on that thread, one portable solution, which is also used in this PR, is to introduce a volatile read as an optimization barrier, which prevents the compiler from optimizing it away.\n\nThe fix can be validated in godbolt here:\n\n- 32-bit: https://godbolt.org/z/jc9j7eb8E\n- 64-bit: https://godbolt.org/z/x8d46Yfah\n\nThe problem was discovered and the solution independently verified by Alexander Wagner \u003calexander.wagner@aisec.fraunhofer.de\u003e and Lea Themint \u003clea.thiemt@tum.de\u003e using their DATA tool:\n\nhttps://github.com/Fraunhofer-AISEC/DATA","status":"published","published":"2024-06-18T21:56:24Z","modified":"2026-02-17T19:30:26Z","cvss":[{"version":"3.1","score":2.9,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"cwes":["CWE-203"],"updated_at":"2026-11-02T14:39:25.82905Z"}],"nvd":[{"id":"CVE-2024-58262","description":"The curve25519-dalek crate before 4.1.3 for Rust has a constant-time operation on elliptic curve scalars that is removed by LLVM.","status":"published","published":"2025-07-27T20:15:25.057Z","modified":"2026-06-17T08:14:44.117Z","cvss":[{"version":"3.1","score":2.9,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low","assessor":"secondary"},{"version":"3.1","score":5.1,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-733"],"updated_at":"2026-11-02T14:10:47.073504Z"}],"osv":[{"id":"CVE-2024-58262","description":"The curve25519-dalek crate before 4.1.3 for Rust has a constant-time operation on elliptic curve scalars that is removed by LLVM.","status":"published","published":"2025-07-27T20:15:25.057Z","modified":"2026-04-10T05:19:10.178882Z","cvss":[{"version":"3.1","score":5.1,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T15:44:45.107804Z"},{"id":"DEBIAN-CVE-2024-58262","description":"The curve25519-dalek crate before 4.1.3 for Rust has a constant-time operation on elliptic curve scalars that is removed by LLVM.","status":"published","published":"2025-07-27T20:15:25.057Z","modified":"2026-11-02T12:03:12.165384803Z","cvss":[{"version":"3.1","score":5.1,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T15:45:44.747956Z"},{"id":"GHSA-x4gp-pqpj-f43q","title":"curve25519-dalek has timing variability in `curve25519-dalek`'s `Scalar29::sub`/`Scalar52::sub`","description":"Timing variability of any kind is problematic when working with  potentially secret values such as elliptic curve scalars, and such issues can potentially leak private keys and other secrets. Such a problem was recently discovered in `curve25519-dalek`.\n\nThe `Scalar29::sub` (32-bit) and `Scalar52::sub` (64-bit) functions contained usage of a mask value inside a loop where LLVM saw an opportunity to insert a branch instruction (`jns` on x86) to conditionally bypass this code section when the mask value is set to zero as can be seen in godbolt:\n\n- 32-bit (see L106): https://godbolt.org/z/zvaWxzvqv\n- 64-bit (see L48): https://godbolt.org/z/PczYj7Pda\n\nA similar problem was recently discovered in the Kyber reference implementation:\n\nhttps://groups.google.com/a/list.nist.gov/g/pqc-forum/c/hqbtIGFKIpU/m/cnE3pbueBgAJ\n\nAs discussed on that thread, one portable solution, which is also used in this PR, is to introduce a volatile read as an optimization barrier, which prevents the compiler from optimizing it away.\n\nThe fix can be validated in godbolt here:\n\n- 32-bit: https://godbolt.org/z/jc9j7eb8E\n- 64-bit: https://godbolt.org/z/x8d46Yfah\n\nThe problem was discovered and the solution independently verified by Alexander Wagner \u003calexander.wagner@aisec.fraunhofer.de\u003e and Lea Themint \u003clea.thiemt@tum.de\u003e using their DATA tool:\n\nhttps://github.com/Fraunhofer-AISEC/DATA","status":"published","published":"2024-06-18T21:56:24Z","modified":"2026-09-10T03:50:15.886084155Z","cvss":[{"version":"3.1","score":2.9,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"cwes":["CWE-203"],"updated_at":"2026-11-02T15:46:59.484835Z"},{"id":"RUSTSEC-2024-0344","title":"Timing variability in `curve25519-dalek`'s `Scalar29::sub`/`Scalar52::sub`","description":"Timing variability of any kind is problematic when working with  potentially secret values such as\nelliptic curve scalars, and such issues can potentially leak private keys and other secrets. Such a\nproblem was recently discovered in `curve25519-dalek`.\n\nThe `Scalar29::sub` (32-bit) and `Scalar52::sub` (64-bit) functions contained usage of a mask value\ninside a loop where LLVM saw an opportunity to insert a branch instruction (`jns` on x86) to\nconditionally bypass this code section when the mask value is set to zero as can be seen in godbolt:\n\n- 32-bit (see L106): \u003chttps://godbolt.org/z/zvaWxzvqv\u003e\n- 64-bit (see L48): \u003chttps://godbolt.org/z/PczYj7Pda\u003e\n\nA similar problem was recently discovered in the Kyber reference implementation:\n\n\u003chttps://groups.google.com/a/list.nist.gov/g/pqc-forum/c/hqbtIGFKIpU/m/cnE3pbueBgAJ\u003e\n\nAs discussed on that thread, one portable solution, which is also used in this PR, is to introduce a\nvolatile read as an optimization barrier, which prevents the compiler from optimizing it away.\n\nThe fix can be validated in godbolt here:\n\n- 32-bit: \u003chttps://godbolt.org/z/jc9j7eb8E\u003e\n- 64-bit: \u003chttps://godbolt.org/z/x8d46Yfah\u003e\n\nThe problem was discovered and the solution independently verified by \nAlexander Wagner \u003calexander.wagner@aisec.fraunhofer.de\u003e and Lea Themint \u003clea.thiemt@tum.de\u003e using\ntheir DATA tool:\n\n\u003chttps://github.com/Fraunhofer-AISEC/DATA\u003e","status":"published","published":"2024-06-18T12:00:00Z","modified":"2025-10-28T06:29:09.774018Z","updated_at":"2026-11-02T15:53:39.971022Z"}]}}
