GHSA-753p-wrj5-g8fj: Pqcrypto hqc PQClean Has A Correctness Error Vulnerability

HIGH
CWE-200 CWE-1240
Published
Advisory Summary

GHSA-753p-wrj5-g8fj is a HIGH pqclean has a correctness error vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Pqcrypto hqc libraries in the crates.io ecosystem. The issue involves pqclean has a correctness error in hqc decapsulation. Remediation is available by upgrading affected packages to version 0.2.1.

GHSA-753p-wrj5-g8fj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-753p-wrj5-g8fj
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Pqcrypto hqc
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-753p-wrj5-g8fj

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

pqcrypto-hqc fixed: 0.2.1
Upgrade pqcrypto-hqc to 0.2.1
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 pqcrypto-hqc

How to Check if You Are Affected

To determine whether your application is affected by GHSA-753p-wrj5-g8fj, inspect your project dependencies for Pqcrypto hqc:

inspect dependencies for pqcrypto-hqc

Analyze the terminal output to locate any version of Pqcrypto hqc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.1), 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Pqcrypto hqc, 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

### Impact A correctness error has been identified in the reference implementation of the HQC key encapsulation mechanism. Due to an indexing error, part of the secret key is incorrectly treated as non-secret data. This results in an incorrect shared secret value being returned when the decapsulation function is called with a malformed ciphertext. No concrete attack exploiting the error has been identified at this point. However, the error involves mishandling of the secret key, and in principle this presents a security vulnerability. ### Patches PQClean does not have a release process, as it is a collection of implementations. If you obtained a HQC implementation from PQClean, please update to a version that includes the fixes proposed in https://github.com/PQClean/PQClean/pull/578. Please also [refer to our security policy](https://github.com/PQClean/PQClean/blob/master/SECURITY.md). ### Workarounds Manually patching is always possible ### Further details In the 2023/04/30 version of the HQC specification and reference implementation, an extra field (sigma) was added to the secret key structure to enable implicit rejection of malformed ciphertexts. The logic to retrieve the public key from the secret key in the decapsulation function was not updated accordingly. As a result, sigma is treated as part of the public key. Later in the decapsulation call, a incorrectly constructed comparison check allows this error to go through undetected. Due to how these two bugs interfere with each other, the decapsulation function never uses sigma to perform implicit rejection; instead, it accepts malformed ciphertexts and returns shared secrets based on their decryptions. ### References This issue was first reported in OQS https://github.com/open-quantum-safe/liboqs/security/advisories/GHSA-gpf4-vrrw-r8v7. The vulnerability was identified by Célian Glénaz and Dahmun Goudarzi (Quarkslab).

GHSA-753p-wrj5-g8fj Affected Pqcrypto hqc Versions

1 component(s)
Fixed Versions:
0.2.1
Product / Package Ecosystem Affected Versions Fixed Version
pqcrypto-hqc
crates.io
< 0.2.1
0.2.1

References

Frequently Asked Questions

What is GHSA-753p-wrj5-g8fj?
GHSA-753p-wrj5-g8fj is a security vulnerability in Pqcrypto hqc involving PQClean has a correctness error in HQC decapsulation under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Pqcrypto hqc versions are affected?
Affected versions include releases prior to 0.2.1 across affected packages: pqcrypto-hqc.
What version fixes GHSA-753p-wrj5-g8fj?
Upgrading to 0.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pqcrypto-hqc affected?
Yes, pqcrypto-hqc is affected in releases prior to 0.2.1. Upgrade your dependency to 0.2.1 or later.
What CWE is associated with GHSA-753p-wrj5-g8fj?
GHSA-753p-wrj5-g8fj is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check crates.io dependencies for GHSA-753p-wrj5-g8fj?
Run the dependency tree command: 'inspect dependencies for pqcrypto-hqc'. 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-753p-wrj5-g8fj",
  "modified" : "2024-12-11T21:48:32Z",
  "published" : "2024-12-11T21:47:37Z",
  "aliases" : [ ],
  "summary" : "PQClean has a correctness error in HQC decapsulation",
  "details" : "### Impact\n\nA correctness error has been identified in the reference implementation of the HQC key encapsulation mechanism. Due to an indexing error, part of the secret key is incorrectly treated as non-secret data. This results in an incorrect shared secret value being returned when the decapsulation function is called with a malformed ciphertext.\n\nNo concrete attack exploiting the error has been identified at this point. However, the error involves mishandling of the secret key, and in principle this presents a security vulnerability.\n\n### Patches\n\nPQClean does not have a release process, as it is a collection of implementations. If you obtained a HQC implementation from PQClean, please update to a version that includes the fixes proposed in https://github.com/PQClean/PQClean/pull/578. \n\nPlease also [refer to our security policy](https://github.com/PQClean/PQClean/blob/master/SECURITY.md).\n\n### Workarounds\n\nManually patching is always possible\n\n### Further details\n\nIn the 2023/04/30 version of the HQC specification and reference implementation, an extra field (sigma) was added to the secret key structure to enable implicit rejection of malformed ciphertexts. The logic to retrieve the public key from the secret key in the decapsulation function was not updated accordingly. As a result, sigma is treated as part of the public key. Later in the decapsulation call, a incorrectly constructed comparison check allows this error to go through undetected. Due to how these two bugs interfere with each other, the decapsulation function never uses sigma to perform implicit rejection; instead, it accepts malformed ciphertexts and returns shared secrets based on their decryptions.\n\n### References\n\nThis issue was first reported in OQS https://github.com/open-quantum-safe/liboqs/security/advisories/GHSA-gpf4-vrrw-r8v7. The vulnerability was identified by Célian Glénaz and Dahmun Goudarzi (Quarkslab).\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "pqcrypto-hqc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/PQClean/PQClean/security/advisories/GHSA-753p-wrj5-g8fj"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-quantum-safe/liboqs/security/advisories/GHSA-gpf4-vrrw-r8v7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PQClean/PQClean/pull/578"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rustpq/pqcrypto/commit/0c07fa8badbf44f67d3ff1571df31ca54e5228c0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/PQClean/PQClean"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1240", "CWE-200" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-11T21:47:37Z",
    "nvd_published_at" : null
  }
}