CWE-1240
Weakness AllowedUse of a Cryptographic Primitive with a Risky Implementation
Abstraction: Base · Status: Draft
To fulfill the need for a cryptographic primitive, the product implements a cryptographic algorithm using a non-standard, unproven, or disallowed/non-compliant cryptographic implementation.
Cryptographic protocols and systems depend on cryptographic primitives (and associated algorithms) as their basic building blocks. Some common examples of primitives are digital signatures, one-way hash functions, ciphers, and public key cryptography; however, the notion of "primitive" can vary depending on point of view. See "Terminology Notes" for further explanation of some concepts.
Cryptographic primitives are defined to accomplish one very specific task in a precisely defined and mathematically reliable fashion. For example, suppose that for a specific cryptographic primitive (such as an encryption routine), the consensus is that the primitive can only be broken after trying out N different inputs (where the larger the value of N, the stronger the cryptography). For an encryption scheme like AES-256, one would expect N to be so large as to be infeasible to execute in a reasonable amount of time.
If a vulnerability is ever found that shows that one can break a cryptographic primitive in significantly less than the expected number of attempts, then that primitive is considered weakened (or sometimes in extreme cases, colloquially it is "broken"). As a result, anything using this cryptographic primitive would now be considered insecure or risky. Thus, even breaking or weakening a seemingly small cryptographic primitive has the potential to render the whole system vulnerable, due to its reliance on the primitive. A historical example can be found in TLS when using DES. One would colloquially call DES the cryptographic primitive for transport encryption in this version of TLS. In the past, DES was considered strong, because no weaknesses were found in it; importantly, DES has a key length of 56 bits. Trying N=2^56 keys was considered impractical for most actors. Unfortunately, attacking a system with 56-bit keys is now practical via brute force, which makes defeating DES encryption practical. It is now practical for an adversary to read any information sent under this version of TLS and use this information to attack the system. As a result, it can be claimed that this use of TLS is weak, and that any system depending on TLS with DES could potentially render the entire system vulnerable to attack.
Cryptographic primitives and associated algorithms are only considered safe after extensive research and review from experienced cryptographers from academia, industry, and government entities looking for any possible flaws. Furthermore, cryptographic primitives and associated algorithms are frequently reevaluated for safety when new mathematical and attack techniques are discovered. As a result and over time, even well-known cryptographic primitives can lose their compliance status with the discovery of novel attacks that might either defeat the algorithm or reduce its robustness significantly.
If ad-hoc cryptographic primitives are implemented, it is almost certain that the implementation will be vulnerable to attacks that are well understood by cryptographers, resulting in the exposure of sensitive information and other consequences.
This weakness is even more difficult to manage for hardware-implemented deployment of cryptographic algorithms. First, because hardware is not patchable as easily as software, any flaw discovered after release and production typically cannot be fixed without a recall of the product. Secondly, the hardware product is often expected to work for years, during which time computation power available to the attacker only increases. Therefore, for hardware implementations of cryptographic primitives, it is absolutely essential that only strong, proven cryptographic primitives are used.
Mapping guidance
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Modes of introduction
This weakness is primarily introduced during the architecture and design phase as risky primitives are included.
Even in cases where the Architectural phase properly specifies a cryptographically secure design, the design may be changed during implementation due to unforeseen constraints.
Detection methods
Architecture or Design Review
Review requirements, documentation, and product design to ensure that primitives are consistent with the strongest-available recommendations from trusted parties. If the product appears to be using custom or proprietary implementations that have not had sufficient public review and approval, then this is a significant concern.
Effectiveness: High
Manual Analysis
Analyze the product to ensure that implementations for each primitive do not contain any known vulnerabilities and are not using any known-weak algorithms, including MD4, MD5, SHA1, DES, etc.
Effectiveness: Moderate
Dynamic Analysis with Manual Results Interpretation
For hardware, during the implementation (pre-Silicon / post-Silicon) phase, dynamic tests should be done to ensure that outputs from cryptographic routines are indeed working properly, such as test vectors provided by NIST [REF-1236].
Effectiveness: Moderate
Dynamic Analysis with Manual Results Interpretation
It needs to be determined if the output of a cryptographic primitive is lacking entropy, which is one clear sign that something went wrong with the crypto implementation. There exist many methods of measuring the entropy of a bytestream, from sophisticated ones (like calculating Shannon's entropy of a sequence of characters) to crude ones (by compressing it and comparing the size of the original bytestream vs. the compressed - a truly random byte stream should not be compressible and hence the uncompressed and compressed bytestreams should be nearly identical in size).
Effectiveness: Moderate
Notes
Terminology
Terminology for cryptography varies widely, from informal and colloquial to mathematically-defined, with different precision and formalism depending on whether the stakeholder is a developer, cryptologist, etc. Yet there is a need for CWE to be self-consistent while remaining understandable and acceptable to multiple audiences.
As of CWE 4.6, CWE terminology around "primitives" and "algorithms" is emerging as shown by the following example, subject to future consultation and agreement within the CWE and cryptography communities. Suppose one wishes to send encrypted data using a CLI tool such as OpenSSL. One might choose to use AES with a 256-bit key and require tamper protection (GCM mode, for instance). For compatibility's sake, one might also choose the ciphertext to be formatted to the PKCS#5 standard. In this case, the "cryptographic system" would be AES-256-GCM with PKCS#5 formatting. The "cryptographic function" would be AES-256 in the GCM mode of operation, and the "algorithm" would be AES. Colloquially, one would say that AES (and sometimes AES-256) is the "cryptographic primitive," because it is the algorithm that realizes the concept of symmetric encryption (without modes of operation or other protocol related modifications). In practice, developers and architects typically refer to base cryptographic algorithms (AES, SHA, etc.) as cryptographic primitives.
Maintenance
Since CWE 4.4, various cryptography-related entries, including CWE-327 and CWE-1240, have been slated for extensive research, analysis, and community consultation to define consistent terminology, improve relationships, and reduce overlap or duplication. As of CWE 4.6, this work is still ongoing.
Content history
provided detection methods and observed examples
Suggested additional HW relationships to help distinguish between different HW CWEs, and/or expose the user to alternatives.
updated Background_Details, Common_Consequences, Demonstrative_Examples, Description, Maintenance_Notes, Modes_of_Introduction, Potential_Mitigations, Related_Attack_Patterns, Research_Gaps
updated Maintenance_Notes, Research_Gaps
updated Background_Details, Demonstrative_Examples, Description, Detection_Factors, Maintenance_Notes, Name, Observed_Examples, Potential_Mitigations, References, Relationships, Terminology_Notes, Weakness_Ordinalities
updated References, Relationships
updated Mapping_Notes
updated Demonstrative_Examples
updated References
updated Relationships
49 vulnerabilities reference this CWE, most recent first.
CVE-2024-0323 (GCVE-0-2024-0323)
Vulnerability from cvelistv5 – Published: 2024-02-05 16:05 – Updated: 2024-09-06 07:21- CWE-1240 - Use of a Cryptographic Primitive with a Risky Implementation
| Vendor | Product | Version | |
|---|---|---|---|
| B&R Industrial Automation | Automation Runtime |
Affected:
14.0 , < 14.93
(custom)
|
|
| br-automation | automation_runtime |
Affected:
14.0 , < 14.93
(custom)
cpe:2.3:a:br-automation:automation_runtime:*:*:*:*:*:*:*:* |
{
"containers": {
"adp": [
{
"providerMetadata": {
"dateUpdated": "2024-08-01T18:04:49.140Z",
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE"
},
"references": [
{
"tags": [
"x_transferred"
],
"url": "https://www.br-automation.com/fileadmin/SA23P004_FTP_uses_unsecure_encryption_mechanisms-f57c147c.pdf"
}
],
"title": "CVE Program Container"
},
{
"affected": [
{
"cpes": [
"cpe:2.3:a:br-automation:automation_runtime:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"product": "automation_runtime",
"vendor": "br-automation",
"versions": [
{
"lessThan": "14.93",
"status": "affected",
"version": "14.0",
"versionType": "custom"
}
]
}
],
"metrics": [
{
"other": {
"content": {
"id": "CVE-2024-0323",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "yes"
},
{
"Technical Impact": "total"
}
],
"role": "CISA Coordinator",
"timestamp": "2024-08-22T14:10:59.497846Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2024-08-22T14:16:16.093Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
}
],
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"modules": [
"SDM"
],
"product": "Automation Runtime",
"vendor": "B\u0026R Industrial Automation",
"versions": [
{
"lessThan": "14.93",
"status": "affected",
"version": "14.0",
"versionType": "custom"
}
]
}
],
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "The FTP server used on the B\u0026amp;R\nAutomation Runtime supports unsecure encryption mechanisms, such as SSLv3,\nTLSv1.0 and TLS1.1. An network-based attacker can exploit the flaws to conduct\nman-in-the-middle attacks or to decrypt communications between the affected product\nclients. \u0026nbsp;\n\n\u003cbr\u003e"
}
],
"value": "The FTP server used on the B\u0026R\nAutomation Runtime supports unsecure encryption mechanisms, such as SSLv3,\nTLSv1.0 and TLS1.1. An network-based attacker can exploit the flaws to conduct\nman-in-the-middle attacks or to decrypt communications between the affected product\nclients."
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "HIGH",
"baseScore": 9.8,
"baseSeverity": "CRITICAL",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"version": "3.1"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-1240",
"description": "CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2024-09-06T07:21:29.270Z",
"orgId": "2b718523-d88f-4f37-9bbd-300c20644bf9",
"shortName": "ABB"
},
"references": [
{
"url": "https://www.br-automation.com/fileadmin/SA23P004_FTP_uses_unsecure_encryption_mechanisms-f57c147c.pdf"
}
],
"source": {
"advisory": "SA23P018",
"discovery": "INTERNAL"
},
"title": "FTP uses unsecure encryption mechanisms",
"x_generator": {
"engine": "Vulnogram 0.1.0-dev"
}
}
},
"cveMetadata": {
"assignerOrgId": "2b718523-d88f-4f37-9bbd-300c20644bf9",
"assignerShortName": "ABB",
"cveId": "CVE-2024-0323",
"datePublished": "2024-02-05T16:05:47.612Z",
"dateReserved": "2024-01-08T13:02:23.041Z",
"dateUpdated": "2024-09-06T07:21:29.270Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.1"
}
CVE-2024-0220 (GCVE-0-2024-0220)
Vulnerability from cvelistv5 – Published: 2024-02-22 10:15 – Updated: 2024-09-19 17:24| Vendor | Product | Version | |
|---|---|---|---|
| B&R Industrial Automation | Automation Studio |
Affected:
4.0 , < 4.6
(patch)
|
|
| B&R Industrial Automation | Technology Guarding |
Affected:
1.0.0 , < 1.4.0
(patch)
|
|
| br-automation | automation_studio |
Affected:
4.0 , < 4.6
(custom)
cpe:2.3:a:br-automation:automation_studio:*:*:*:*:*:*:*:* |
{
"containers": {
"adp": [
{
"providerMetadata": {
"dateUpdated": "2024-08-01T17:41:15.976Z",
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE"
},
"references": [
{
"tags": [
"x_transferred"
],
"url": "https://www.br-automation.com/fileadmin/SA23P019_Automation_Studio_Upgrade_Service_uses_insufficient_encryption.pdf-1b3b181c.pdf"
}
],
"title": "CVE Program Container"
},
{
"affected": [
{
"cpes": [
"cpe:2.3:a:br-automation:automation_studio:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unknown",
"product": "automation_studio",
"vendor": "br-automation",
"versions": [
{
"lessThan": "4.6",
"status": "affected",
"version": "4.0",
"versionType": "custom"
}
]
}
],
"metrics": [
{
"other": {
"content": {
"id": "CVE-2024-0220",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "total"
}
],
"role": "CISA Coordinator",
"timestamp": "2024-02-22T16:23:26.378691Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2024-08-28T16:52:09.908Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
}
],
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"modules": [
"Upgrade Service"
],
"product": "Automation Studio",
"vendor": "B\u0026R Industrial Automation",
"versions": [
{
"lessThan": "4.6",
"status": "affected",
"version": "4.0",
"versionType": "patch"
}
]
},
{
"defaultStatus": "unaffected",
"product": "Technology Guarding",
"vendor": "B\u0026R Industrial Automation",
"versions": [
{
"lessThan": "1.4.0",
"status": "affected",
"version": "1.0.0",
"versionType": "patch"
}
]
}
],
"datePublic": "2024-02-22T10:10:00.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "B\u0026amp;R Automation Studio Upgrade Service and B\u0026amp;R Technology Guarding use insufficient cryptography for communication to the upgrade and the licensing servers. A network-based attacker could exploit the vulnerability to execute arbitrary code on the products or sniff sensitive data.\n\n\u003cbr\u003e"
}
],
"value": "B\u0026R Automation Studio Upgrade Service and B\u0026R Technology Guarding use insufficient cryptography for communication to the upgrade and the licensing servers. A network-based attacker could exploit the vulnerability to execute arbitrary code on the products or sniff sensitive data."
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "HIGH",
"attackVector": "NETWORK",
"availabilityImpact": "HIGH",
"baseScore": 8.3,
"baseSeverity": "HIGH",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"privilegesRequired": "NONE",
"scope": "CHANGED",
"userInteraction": "REQUIRED",
"vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H",
"version": "3.1"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-1240",
"description": "CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation",
"lang": "en",
"type": "CWE"
}
]
},
{
"descriptions": [
{
"cweId": "CWE-319",
"description": "CWE-319 Cleartext Transmission of Sensitive Information",
"lang": "en",
"type": "CWE"
}
]
},
{
"descriptions": [
{
"cweId": "CWE-94",
"description": "CWE-94 Improper Control of Generation of Code (\u0027Code Injection\u0027)",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2024-09-19T17:24:51.723Z",
"orgId": "2b718523-d88f-4f37-9bbd-300c20644bf9",
"shortName": "ABB"
},
"references": [
{
"url": "https://www.br-automation.com/fileadmin/SA23P019_Automation_Studio_Upgrade_Service_uses_insufficient_encryption.pdf-1b3b181c.pdf"
}
],
"source": {
"advisory": "2023-P019",
"discovery": "INTERNAL"
},
"title": "B\u0026R products use insufficient communication encryption",
"x_generator": {
"engine": "Vulnogram 0.1.0-dev"
}
}
},
"cveMetadata": {
"assignerOrgId": "2b718523-d88f-4f37-9bbd-300c20644bf9",
"assignerShortName": "ABB",
"cveId": "CVE-2024-0220",
"datePublished": "2024-02-22T10:15:44.750Z",
"dateReserved": "2024-01-03T15:46:41.224Z",
"dateUpdated": "2024-09-19T17:24:51.723Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.1"
}
CVE-2023-51392 (GCVE-0-2023-51392)
Vulnerability from cvelistv5 – Published: 2024-02-23 16:12 – Updated: 2025-04-22 16:15- CWE-1240 - Use of a Cryptographic Primitive with a Risky Implementation
| Vendor | Product | Version | |
|---|---|---|---|
| silabs.com | Ember ZNet SDK |
Affected:
7.2.0 , < 7.4.0
(7.x)
|
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2023-51392",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2024-07-25T17:59:54.322798Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2025-04-22T16:15:25.335Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
},
{
"providerMetadata": {
"dateUpdated": "2024-08-02T22:32:09.157Z",
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE"
},
"references": [
{
"tags": [
"x_transferred"
],
"url": "https://community.silabs.com/068Vm000001BKm6"
}
],
"title": "CVE Program Container"
}
],
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"packageName": "Ember ZNet SDK",
"platforms": [
"32 bit",
"ARM"
],
"product": "Ember ZNet SDK",
"repo": "https://github.com/SiliconLabs/gecko_sdk/releases",
"vendor": "silabs.com",
"versions": [
{
"lessThan": "7.4.0",
"status": "affected",
"version": "7.2.0",
"versionType": "7.x"
}
]
}
],
"datePublic": "2024-02-15T17:32:00.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "Ember ZNet between v7.2.0 and v7.4.0 used software AES-CCM instead of integrated hardware cryptographic accelerators, potentially increasing risk of electromagnetic and differential power analysis sidechannel attacks."
}
],
"value": "Ember ZNet between v7.2.0 and v7.4.0 used software AES-CCM instead of integrated hardware cryptographic accelerators, potentially increasing risk of electromagnetic and differential power analysis sidechannel attacks."
}
],
"impacts": [
{
"capecId": "CAPEC-622",
"descriptions": [
{
"lang": "en",
"value": "CAPEC-622 Electromagnetic Side-Channel Attack"
}
]
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "LOCAL",
"availabilityImpact": "NONE",
"baseScore": 6.2,
"baseSeverity": "MEDIUM",
"confidentialityImpact": "HIGH",
"integrityImpact": "NONE",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"version": "3.1"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-1240",
"description": "CWE-1240 Use of a Cryptographic Primitive with a Risky Implementation",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2024-09-27T15:41:55.288Z",
"orgId": "030b2754-1501-44a4-bef8-48be86a33bf4",
"shortName": "Silabs"
},
"references": [
{
"url": "https://community.silabs.com/068Vm000001BKm6"
}
],
"source": {
"discovery": "UNKNOWN"
},
"title": "Silicon Labs EFR32xxx parts with classic key storage do not use hardware accelerated AES-CCM",
"x_generator": {
"engine": "Vulnogram 0.1.0-dev"
}
}
},
"cveMetadata": {
"assignerOrgId": "030b2754-1501-44a4-bef8-48be86a33bf4",
"assignerShortName": "Silabs",
"cveId": "CVE-2023-51392",
"datePublished": "2024-02-23T16:12:41.261Z",
"dateReserved": "2023-12-18T20:56:24.812Z",
"dateUpdated": "2025-04-22T16:15:25.335Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.1"
}
GHSA-25RM-9WVM-M38V
Vulnerability from github – Published: 2026-11-20 00:17 – Updated: 2026-11-20 00:17Reporter: Connor Webber
Package: falcon-rust (crates.io), repository github.com/aszepieniec/falcon-rust
Affected: v0.1.3 and the current master (HEAD cfa1b35). Regression introduced in commit bf2cf00.
Component: discrete-Gaussian sampler, src/samplerz.rs (approx_exp, ber_exp, sampler_z)
Status: Confirmed by source review and by empirical measurement of the crate's own compiled code.
Summary
falcon-rust's discrete-Gaussian rejection sampler evaluates its exp() acceptance step at only 32 bits of fractional precision. Measured directly against the crate's own compiled code, approx_exp has a maximum relative error of 2^-33. For comparison, the Falcon reference implementation achieves about 2^-63, and the f64 code this crate replaced achieved about 2^-52. The current sampler is therefore roughly 2^19 (about 500,000x) less precise than the version it replaced, and about 2^30 less precise than the reference.
Falcon's security proof relies on the sampled signatures being statistically indistinguishable from an ideal discrete Gaussian, so the signature transcript leaks nothing about the secret trapdoor. That guarantee holds only when the sampler's relative error stays small enough, over the roughly 2^64 signature budget, to keep the Renyi divergence between the real and ideal distributions negligible. The precision the security analysis relies on is cited in the literature between roughly 2^-40 and 2^-46 (for example the FACCT and isochronous-sampling analyses). At 2^-33 the sampler is below every value in that range, roughly 128x to 4096x too coarse depending on which bound you take, so the precondition the proof depends on is not met.
There is a second, bound-independent piece of evidence that removes any ambiguity: the crate's sampler can no longer reproduce Falcon's known-answer test (KAT) vectors, which are the authoritative correctness oracle. Rather than restore the precision, the maintainers loosened their own test tolerance and noted that "rejection decisions may differ at the boundary." The regression is already visible in-tree; its security significance was simply not recognized.
Because the sampler's sigma is derived from the secret basis Gram-Schmidt norms, the resulting distribution deviation is secret-dependent. The exp function itself is public, but its inputs, and therefore the deviation, depend on secret quantities. This is the class of flaw that statistical and hidden-number-problem learning attacks on biased Gaussian samplers target.
The crate's own documentation describes this sampler as "side-channel-hardened" and notes that "the sampler defines the secret-key distribution, so getting it wrong weakens the cryptography," which is exactly the property this defect touches.
Technical detail
Root location: src/samplerz.rs
FixedPoint64 = FixedPoint<i64>withFRAC_UNIT = 1 << 32, i.e. 32 fractional bits (src/fixed_point.rs). The crate already definesFixedPoint128with 64 fractional bits, the correct-precision type, but the sampler usesFixedPoint64.approx_exp(samplerz.rs:34) evaluates the FACCT polynomial, whose coefficients are the correct 63-bit constants, but at line 59 it doeslet z: u64 = (x.0 as u64) << 31;. This takes the 32-bit-precision argument and zero-fills the low 31 bits into a 63-bit word, so the polynomial is evaluated at an argument quantized to 2^-32.sampler_zcomputesdss = 0.5 * isigma^2andccs = sigma_min * isigmain this 32-bit type, wheresigmais the per-leaf value derived from the secret basis Gram-Schmidt norms (ffSampling). The precision loss therefore lands on secret-dependent quantities.
Regression: commit bf2cf00 ("Eliminate f64 from key generation via generic FixedPoint") replaced the prior f64 sampler. git show bf2cf00^:src/samplerz.rs shows the old fn approx_exp(x: f64, ccs: f64) operating at 63-bit scale. The change landed before the 0.1.3 release. The maintainers then re-pinned their tests to the degraded output and loosened the tolerance, and the Falcon KAT vectors no longer pass.
Proof of concept (self-contained, reproducible)
Append the following module to falcon-rust/src/samplerz.rs and run:
cargo test -p falcon-rust --release dump_approx_exp_precision -- --nocapture
It calls the crate's own approx_exp and measures its maximum relative error against true exp() over the sampler's input domain [0, ln 2].
#[cfg(test)]
mod prec_test {
use super::*;
#[test]
fn dump_approx_exp_precision() {
let n: u64 = 500000;
let mut maxrel = 0.0f64;
let two63 = 9223372036854775808.0f64; // 2^63
for i in 0..=n {
let x = (i as f64 / n as f64) * std::f64::consts::LN_2;
let approx_u = approx_exp(FixedPoint64::from(x), FixedPoint64::ONE);
let approx = approx_u as f64 / two63; // ~ exp(-x)
let truev = (-x).exp();
let rel = ((approx - truev) / truev).abs();
if rel > maxrel { maxrel = rel; }
}
println!("MAXREL_APPROX_EXP={:.6e} log2={:.3}", maxrel, maxrel.log2());
let req = 2f64.powi(-40);
println!("FALCON_REQ_2^-40={:.3e} RATIO_OVER_REQ={:.1}x", req, maxrel / req);
let f64ref = 2f64.powi(-52);
println!("F64_SAMPLER_2^-52={:.3e} RATIO_OVER_F64={:.1}x", f64ref, maxrel / f64ref);
}
}
Measured output (rustc 1.96.1, x86-64, release):
MAXREL_APPROX_EXP=1.164152e-10 log2=-33.000
FALCON_REQ_2^-40=9.095e-13 RATIO_OVER_REQ=128.0x
F64_SAMPLER_2^-52=2.220e-16 RATIO_OVER_F64=524287.3x
So the sampler is at 2^-33, about 128x coarser than even the loosest cited requirement (2^-40), and about 500,000x coarser than the f64 sampler this code replaced.
Impact
The sampler's output distribution deviates from the specified discrete Gaussian by more than the security analysis allows, so the Renyi-divergence argument that guarantees the signature transcript hides the secret trapdoor no longer applies. Because the same sampler is used at key-generation time, the secret key itself is also drawn from a distribution that differs from the specified one. The deviation is secret-dependent, which is the property that statistical and hidden-number-problem learning attacks on biased Gaussian samplers exploit.
To be precise about scope (see Severity): this is a measured precision defect that voids the proof's precondition. It is not a demonstrated end-to-end key recovery.
Severity (honest scoping)
Medium. This is a measured failure to meet the scheme's mandated sampler precision, which for a cryptographic library is a defect in its own right, because the security proof's precondition is provably not met and the reference KAT vectors fail. It is not a demonstrated key-recovery attack. Being coarser than the required bound invalidates the proof, but does not by itself establish a practical break. Showing recovery would require a full statistical-learning simulation over many signatures, and whether that is feasible within a realistic signature budget at a per-sample bias of 2^-33 is an open question. That uncertainty is why this is scoped as an unsoundness and proof-conformance defect rather than a claimed exploit. Suggested RUSTSEC classification: informational = "unsound" (cryptographic-soundness defect), or a Medium advisory.
Fix
Perform sampler_z, ber_exp, and approx_exp at 53-bit precision (f64) or higher, or use the crate's existing FixedPoint128 (64 fractional bits) throughout the acceptance-probability computation. Restore the Falcon reference KAT vectors as the test oracle instead of the loosened tolerance.
Disclosure
Coordinated. Private notification to the maintainer first (this GitHub advisory), then RUSTSEC advisory-db. No public disclosure before maintainer contact.
Note on tooling
Claude Opus (Anthropic's coding assistant) was used to help test the hypothesis, specifically to build the crate and measure approx_exp against high-precision exp, and to help prepare this report. The measurements above are deterministic and independently reproducible with the included test.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.1.3"
},
"package": {
"ecosystem": "crates.io",
"name": "falcon-rust"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.2.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-77382"
],
"database_specific": {
"cwe_ids": [
"CWE-1240"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-20T00:17:04Z",
"nvd_published_at": "2026-11-19T17:19:00Z",
"severity": "MODERATE"
},
"details": "**Reporter:** Connor Webber\n**Package:** `falcon-rust` (crates.io), repository `github.com/aszepieniec/falcon-rust`\n**Affected:** v0.1.3 and the current `master` (HEAD `cfa1b35`). Regression introduced in commit `bf2cf00`.\n**Component:** discrete-Gaussian sampler, `src/samplerz.rs` (`approx_exp`, `ber_exp`, `sampler_z`)\n**Status:** Confirmed by source review and by empirical measurement of the crate\u0027s own compiled code.\n\n## Summary\n\nfalcon-rust\u0027s discrete-Gaussian rejection sampler evaluates its `exp()` acceptance step at only 32 bits of fractional precision. Measured directly against the crate\u0027s own compiled code, `approx_exp` has a maximum relative error of 2^-33. For comparison, the Falcon reference implementation achieves about 2^-63, and the f64 code this crate replaced achieved about 2^-52. The current sampler is therefore roughly 2^19 (about 500,000x) less precise than the version it replaced, and about 2^30 less precise than the reference.\n\nFalcon\u0027s security proof relies on the sampled signatures being statistically indistinguishable from an ideal discrete Gaussian, so the signature transcript leaks nothing about the secret trapdoor. That guarantee holds only when the sampler\u0027s relative error stays small enough, over the roughly 2^64 signature budget, to keep the Renyi divergence between the real and ideal distributions negligible. The precision the security analysis relies on is cited in the literature between roughly 2^-40 and 2^-46 (for example the FACCT and isochronous-sampling analyses). At 2^-33 the sampler is below every value in that range, roughly 128x to 4096x too coarse depending on which bound you take, so the precondition the proof depends on is not met.\n\nThere is a second, bound-independent piece of evidence that removes any ambiguity: the crate\u0027s sampler can no longer reproduce Falcon\u0027s known-answer test (KAT) vectors, which are the authoritative correctness oracle. Rather than restore the precision, the maintainers loosened their own test tolerance and noted that \"rejection decisions may differ at the boundary.\" The regression is already visible in-tree; its security significance was simply not recognized.\n\nBecause the sampler\u0027s sigma is derived from the secret basis Gram-Schmidt norms, the resulting distribution deviation is secret-dependent. The `exp` function itself is public, but its inputs, and therefore the deviation, depend on secret quantities. This is the class of flaw that statistical and hidden-number-problem learning attacks on biased Gaussian samplers target.\n\nThe crate\u0027s own documentation describes this sampler as \"side-channel-hardened\" and notes that \"the sampler defines the secret-key distribution, so getting it wrong weakens the cryptography,\" which is exactly the property this defect touches.\n\n## Technical detail\n\nRoot location: `src/samplerz.rs`\n\n* `FixedPoint64 = FixedPoint\u003ci64\u003e` with `FRAC_UNIT = 1 \u003c\u003c 32`, i.e. 32 fractional bits (`src/fixed_point.rs`). The crate already defines `FixedPoint128` with 64 fractional bits, the correct-precision type, but the sampler uses `FixedPoint64`.\n* `approx_exp` (`samplerz.rs:34`) evaluates the FACCT polynomial, whose coefficients are the correct 63-bit constants, but at line 59 it does `let z: u64 = (x.0 as u64) \u003c\u003c 31;`. This takes the 32-bit-precision argument and zero-fills the low 31 bits into a 63-bit word, so the polynomial is evaluated at an argument quantized to 2^-32.\n* `sampler_z` computes `dss = 0.5 * isigma^2` and `ccs = sigma_min * isigma` in this 32-bit type, where `sigma` is the per-leaf value derived from the secret basis Gram-Schmidt norms (ffSampling). The precision loss therefore lands on secret-dependent quantities.\n\nRegression: commit `bf2cf00` (\"Eliminate f64 from key generation via generic FixedPoint\u003cT\u003e\") replaced the prior f64 sampler. `git show bf2cf00^:src/samplerz.rs` shows the old `fn approx_exp(x: f64, ccs: f64)` operating at 63-bit scale. The change landed before the 0.1.3 release. The maintainers then re-pinned their tests to the degraded output and loosened the tolerance, and the Falcon KAT vectors no longer pass.\n\n## Proof of concept (self-contained, reproducible)\n\nAppend the following module to `falcon-rust/src/samplerz.rs` and run:\n\n`cargo test -p falcon-rust --release dump_approx_exp_precision -- --nocapture`\n\nIt calls the crate\u0027s own `approx_exp` and measures its maximum relative error against true `exp()` over the sampler\u0027s input domain `[0, ln 2]`.\n\n```rust\n#[cfg(test)]\nmod prec_test {\n use super::*;\n #[test]\n fn dump_approx_exp_precision() {\n let n: u64 = 500000;\n let mut maxrel = 0.0f64;\n let two63 = 9223372036854775808.0f64; // 2^63\n for i in 0..=n {\n let x = (i as f64 / n as f64) * std::f64::consts::LN_2;\n let approx_u = approx_exp(FixedPoint64::from(x), FixedPoint64::ONE);\n let approx = approx_u as f64 / two63; // ~ exp(-x)\n let truev = (-x).exp();\n let rel = ((approx - truev) / truev).abs();\n if rel \u003e maxrel { maxrel = rel; }\n }\n println!(\"MAXREL_APPROX_EXP={:.6e} log2={:.3}\", maxrel, maxrel.log2());\n let req = 2f64.powi(-40);\n println!(\"FALCON_REQ_2^-40={:.3e} RATIO_OVER_REQ={:.1}x\", req, maxrel / req);\n let f64ref = 2f64.powi(-52);\n println!(\"F64_SAMPLER_2^-52={:.3e} RATIO_OVER_F64={:.1}x\", f64ref, maxrel / f64ref);\n }\n}\n```\n\nMeasured output (rustc 1.96.1, x86-64, release):\n\n```\nMAXREL_APPROX_EXP=1.164152e-10 log2=-33.000\nFALCON_REQ_2^-40=9.095e-13 RATIO_OVER_REQ=128.0x\nF64_SAMPLER_2^-52=2.220e-16 RATIO_OVER_F64=524287.3x\n```\n\nSo the sampler is at 2^-33, about 128x coarser than even the loosest cited requirement (2^-40), and about 500,000x coarser than the f64 sampler this code replaced.\n\n## Impact\n\nThe sampler\u0027s output distribution deviates from the specified discrete Gaussian by more than the security analysis allows, so the Renyi-divergence argument that guarantees the signature transcript hides the secret trapdoor no longer applies. Because the same sampler is used at key-generation time, the secret key itself is also drawn from a distribution that differs from the specified one. The deviation is secret-dependent, which is the property that statistical and hidden-number-problem learning attacks on biased Gaussian samplers exploit.\n\nTo be precise about scope (see Severity): this is a measured precision defect that voids the proof\u0027s precondition. It is not a demonstrated end-to-end key recovery.\n\n## Severity (honest scoping)\n\nMedium. This is a measured failure to meet the scheme\u0027s mandated sampler precision, which for a cryptographic library is a defect in its own right, because the security proof\u0027s precondition is provably not met and the reference KAT vectors fail. It is not a demonstrated key-recovery attack. Being coarser than the required bound invalidates the proof, but does not by itself establish a practical break. Showing recovery would require a full statistical-learning simulation over many signatures, and whether that is feasible within a realistic signature budget at a per-sample bias of 2^-33 is an open question. That uncertainty is why this is scoped as an unsoundness and proof-conformance defect rather than a claimed exploit. Suggested RUSTSEC classification: `informational = \"unsound\"` (cryptographic-soundness defect), or a Medium advisory.\n\n## Fix\n\nPerform `sampler_z`, `ber_exp`, and `approx_exp` at 53-bit precision (f64) or higher, or use the crate\u0027s existing `FixedPoint128` (64 fractional bits) throughout the acceptance-probability computation. Restore the Falcon reference KAT vectors as the test oracle instead of the loosened tolerance.\n\n## Disclosure\n\nCoordinated. Private notification to the maintainer first (this GitHub advisory), then RUSTSEC advisory-db. No public disclosure before maintainer contact.\n\n## Note on tooling\n\nClaude Opus (Anthropic\u0027s coding assistant) was used to help test the hypothesis, specifically to build the crate and measure `approx_exp` against high-precision `exp`, and to help prepare this report. The measurements above are deterministic and independently reproducible with the included test.",
"id": "GHSA-25rm-9wvm-m38v",
"modified": "2026-11-20T00:17:04Z",
"published": "2026-11-20T00:17:04Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/aszepieniec/falcon-rust/security/advisories/GHSA-25rm-9wvm-m38v"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-77382"
},
{
"type": "WEB",
"url": "https://github.com/aszepieniec/falcon-rust/commit/930d766256f9d67ec9b6d437557286cf47f042ca"
},
{
"type": "WEB",
"url": "https://github.com/aszepieniec/falcon-rust/commit/bf2cf000e63a9803f7ab1a34f629a5a0e9c49cf6"
},
{
"type": "PACKAGE",
"url": "https://github.com/aszepieniec/falcon-rust"
},
{
"type": "WEB",
"url": "https://github.com/aszepieniec/falcon-rust/releases/tag/v0.2.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "falcon-rust: Discrete-Gaussian sampler runs at 2^-33 precision, far below Falcon\u0027s requirement (reference KAT vectors no longer pass)"
}
GHSA-2WC6-2RCJ-8V76
Vulnerability from github – Published: 2021-08-25 21:00 – Updated: 2023-06-13 20:56The scalarmult() function included in previous versions of this crate accepted all-zero public keys, for which the resulting Diffie-Hellman shared secret will always be zero regardless of the private key used.
This issue was fixed by checking for this class of keys and rejecting them if they are used.
{
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "sodiumoxide"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.14"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2017-1000168"
],
"database_specific": {
"cwe_ids": [
"CWE-1240"
],
"github_reviewed": true,
"github_reviewed_at": "2021-08-05T21:10:47Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "The scalarmult() function included in previous versions of this crate accepted all-zero public keys, for which the resulting Diffie-Hellman shared secret will always be zero regardless of the private key used.\n\nThis issue was fixed by checking for this class of keys and rejecting them if they are used.",
"id": "GHSA-2wc6-2rcj-8v76",
"modified": "2023-06-13T20:56:05Z",
"published": "2021-08-25T21:00:41Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-1000168"
},
{
"type": "WEB",
"url": "https://github.com/dnaq/sodiumoxide/issues/154"
},
{
"type": "WEB",
"url": "https://github.com/sodiumoxide/sodiumoxide/commit/24c7a5550807ac8a09648b5878f19d14c3a69135"
},
{
"type": "PACKAGE",
"url": "https://github.com/sodiumoxide/sodiumoxide"
},
{
"type": "WEB",
"url": "https://rustsec.org/advisories/RUSTSEC-2017-0001.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "scalarmult() vulnerable to degenerate public keys"
}
GHSA-3C3Q-FQQ7-42MJ
Vulnerability from github – Published: 2026-08-24 15:31 – Updated: 2026-08-24 15:31HCL Hive is affected by a cryptographic primitive with a risky implementation which could allow an attacker unauthorized lateral compromise or widespread credential leakage if a single internal component is breached.
{
"affected": [],
"aliases": [
"CVE-2026-21751"
],
"database_specific": {
"cwe_ids": [
"CWE-1240"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-08-24T14:16:52Z",
"severity": "HIGH"
},
"details": "HCL Hive is affected by a cryptographic primitive with a risky implementation which could allow an attacker unauthorized lateral compromise or widespread credential leakage if a single internal component is breached.",
"id": "GHSA-3c3q-fqq7-42mj",
"modified": "2026-08-24T15:31:51Z",
"published": "2026-08-24T15:31:51Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-21751"
},
{
"type": "WEB",
"url": "https://support.hcl-software.com/csm?id=kb_article\u0026sysparm_article=KB0131731"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-3HG2-RH4R-8QF6
Vulnerability from github – Published: 2025-12-12 18:30 – Updated: 2025-12-20 02:40When encrypting sensitive data, weak encryption keys that are fixed or directly generated based on user passwords are used. Attackers can obtain these keys through methods such as reverse engineering, code leaks, or password guessing, thereby decrypting stored or transmitted encrypted data, leading to the leakage of sensitive information.
This issue affects Apache StreamPark: from 2.0.0 before 2.1.7.
Users are recommended to upgrade to version 2.1.7, which fixes the issue.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.streampark:streampark"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.1.7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-53960"
],
"database_specific": {
"cwe_ids": [
"CWE-1240"
],
"github_reviewed": true,
"github_reviewed_at": "2025-12-12T20:19:56Z",
"nvd_published_at": "2025-12-12T16:15:44Z",
"severity": "HIGH"
},
"details": "When encrypting sensitive data, weak encryption keys that are fixed or directly generated based on user passwords are used. Attackers can obtain these keys through methods such as reverse engineering, code leaks, or password guessing, thereby decrypting stored or transmitted encrypted data, leading to the leakage of sensitive information.\n\nThis issue affects Apache StreamPark: from 2.0.0 before 2.1.7.\n\nUsers are recommended to upgrade to version 2.1.7, which fixes the issue.",
"id": "GHSA-3hg2-rh4r-8qf6",
"modified": "2025-12-20T02:40:33Z",
"published": "2025-12-12T18:30:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-53960"
},
{
"type": "WEB",
"url": "https://github.com/apache/streampark/commit/39034db0c806168afa82e58e4f376e1e3c3b73e4"
},
{
"type": "PACKAGE",
"url": "https://github.com/apache/streampark"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread/xlpvfzf5l5m5mfyjwrz5h4dssm3c32vy"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2025/12/04/1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Apache StreamPark: Use the user\u2019s password as the secret key Vulnerability"
}
GHSA-42VR-VVGX-QHGX
Vulnerability from github – Published: 2026-03-25 21:30 – Updated: 2026-03-25 21:30IBM Concert 1.0.0 through 2.2.0 uses weaker than expected cryptographic algorithms that could allow an attacker to decrypt highly sensitive information
{
"affected": [],
"aliases": [
"CVE-2025-64647"
],
"database_specific": {
"cwe_ids": [
"CWE-1240"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-03-25T21:16:25Z",
"severity": "MODERATE"
},
"details": "IBM Concert 1.0.0 through 2.2.0 uses weaker than expected cryptographic algorithms that could allow an attacker to decrypt highly sensitive information",
"id": "GHSA-42vr-vvgx-qhgx",
"modified": "2026-03-25T21:30:36Z",
"published": "2026-03-25T21:30:36Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-64647"
},
{
"type": "WEB",
"url": "https://www.ibm.com/support/pages/node/7267105"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-434V-X5QV-PMH6
Vulnerability from github – Published: 2026-03-26 17:58 – Updated: 2026-03-26 17:58The libcrux-ed25519 key generation samples Ed25519 secret keys from a provided CSPRNG in a loop for up to 100 attempts until a non-zero key is found. If a non-zero key could not be sampled within 100 attempts the key generation function would silently continue with an all-zero buffer as the secret key.
Impact
This bug only occurs in the event of a catastrophic failure of the CSPRNG, but would allow anyone to forge signatures under the resulting static signing key.
Mitigation
Instead of silently continuing with an all-zero signing key, starting from version 0.0.7 key generation will error in the case of 100 failed attempts at sampling a valid key.
{
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "libcrux-ed25519"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-1240",
"CWE-331",
"CWE-392"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-26T17:58:55Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "The libcrux-ed25519 key generation samples Ed25519 secret keys from a provided CSPRNG in a loop for up to 100 attempts until a non-zero key is found. If a non-zero key could not be sampled within 100 attempts the key generation function would silently continue with an all-zero buffer as the secret key.\n\n## Impact\nThis bug only occurs in the event of a catastrophic failure of the CSPRNG, but would allow anyone to forge signatures under the resulting static signing key.\n\n## Mitigation\nInstead of silently continuing with an all-zero signing key, starting from version `0.0.7` key generation will error in the case of 100 failed attempts at sampling a valid key.",
"id": "GHSA-434v-x5qv-pmh6",
"modified": "2026-03-26T17:58:55Z",
"published": "2026-03-26T17:58:55Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/cryspen/libcrux/pull/1349"
},
{
"type": "PACKAGE",
"url": "https://github.com/cryspen/libcrux"
},
{
"type": "WEB",
"url": "https://rustsec.org/advisories/RUSTSEC-2026-0075.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "libcrux has All-Zero Key Generation Upon Catastrophic RNG Failure"
}
GHSA-4GJP-9G3V-JFMP
Vulnerability from github – Published: 2026-07-14 18:32 – Updated: 2026-07-14 18:32Use of a cryptographic primitive with a risky implementation in Windows Key Guard allows an authorized attacker to bypass a security feature locally.
{
"affected": [],
"aliases": [
"CVE-2026-50303"
],
"database_specific": {
"cwe_ids": [
"CWE-1240"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-07-14T17:16:58Z",
"severity": "MODERATE"
},
"details": "Use of a cryptographic primitive with a risky implementation in Windows Key Guard allows an authorized attacker to bypass a security feature locally.",
"id": "GHSA-4gjp-9g3v-jfmp",
"modified": "2026-07-14T18:32:04Z",
"published": "2026-07-14T18:32:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-50303"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-50303"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
Mitigation MIT-55
Require compliance with the strongest-available recommendations from trusted parties, and require that compliance must be kept up-to-date, since recommendations evolve over time. For example, US government systems require FIPS 140-3 certification, which supersedes FIPS 140-2 [REF-1192] [REF-267].
Mitigation
Ensure that the architecture/design uses the strongest-available primitives and algorithms from trusted parties. For example, US government systems require FIPS 140-3 certification, which supersedes FIPS 140-2 [REF-1192] [REF-267].
Mitigation MIT-54
Do not develop custom or private cryptographic algorithms. They will likely be exposed to attacks that are well-understood by cryptographers. As with all cryptographic mechanisms, the source code should be available for analysis. If the algorithm may be compromised when attackers find out how it works, then it is especially weak.
Mitigation
Try not to use cryptographic algorithms in novel ways or with new modes of operation even when you "know" it is secure. For example, using SHA-2 chaining to create a 1-time pad for encryption might sound like a good idea, but one should not do this.
Mitigation MIT-52
Ensure that the design can replace one cryptographic primitive or algorithm with another in the next generation ("cryptographic agility"). Where possible, use wrappers to make the interfaces uniform. This will make it easier to upgrade to stronger algorithms. This is especially important for hardware, which can be more difficult to upgrade quickly than software; design the hardware at a replaceable block level.
Mitigation
Do not use outdated or non-compliant cryptography algorithms. Some older algorithms, once thought to require a billion years of computing time, can now be broken in days or hours. This includes MD4, MD5, SHA1, DES, and other algorithms that were once regarded as strong [REF-267].
Mitigation
Do not use a linear-feedback shift register (LFSR) or other legacy methods as a substitute for an accepted and standard Random Number Generator.
Mitigation
Do not use a checksum as a substitute for a cryptographically generated hash.
Mitigation
Strategy: Libraries or Frameworks
Use a vetted cryptographic library or framework. Industry-standard implementations will save development time and are more likely to avoid errors that can occur during implementation of cryptographic algorithms. However, the library/framework could be used incorrectly during implementation.
Mitigation
When using industry-approved techniques, use them correctly. Don't cut corners by skipping resource-intensive steps (CWE-325). These steps are often essential for the prevention of common attacks.
Mitigation
Do not store keys in areas accessible to untrusted agents. Carefully manage and protect the cryptographic keys (see CWE-320). If the keys can be guessed or stolen, then the strength of the cryptography algorithm is irrelevant.
CAPEC-97: Cryptanalysis
Cryptanalysis is a process of finding weaknesses in cryptographic algorithms and using these weaknesses to decipher the ciphertext without knowing the secret key (instance deduction). Sometimes the weakness is not in the cryptographic algorithm itself, but rather in how it is applied that makes cryptanalysis successful. An attacker may have other goals as well, such as: Total Break (finding the secret key), Global Deduction (finding a functionally equivalent algorithm for encryption and decryption that does not require knowledge of the secret key), Information Deduction (gaining some information about plaintexts or ciphertexts that was not previously known) and Distinguishing Algorithm (the attacker has the ability to distinguish the output of the encryption (ciphertext) from a random permutation of bits).