GHSA-fq33-vmhv-48xh: ntru-rs has unsound FFI Wrong API Usage Causes Write Vulnerability

MODERATE
Published
Advisory Summary

GHSA-fq33-vmhv-48xh is a MODERATE wrong api usage causes write vulnerability (General Security Weakness) affecting ntru-rs has unsound FFI libraries in the crates.io ecosystem. The issue involves wrong api usage causes write past allocated area. Remediation is available in the latest vendor maintenance releases.

GHSA-fq33-vmhv-48xh at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-fq33-vmhv-48xh
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product ntru-rs has unsound FFI
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-fq33-vmhv-48xh

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

ntru fixed: Latest secure release
Upgrade ntru to Latest secure release
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 ntru

How to Check if You Are Affected

To determine whether your application is affected by GHSA-fq33-vmhv-48xh, inspect your project dependencies for ntru-rs has unsound FFI:

inspect dependencies for ntru

Analyze the terminal output to locate any version of ntru-rs has unsound FFI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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 General Security Weakness. In ntru-rs has unsound FFI, 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

The following usage causes undefined behavior. ```rust let kp: ntru::types::KeyPair = …; kp.get_public().export(Default::default()) ``` When compiled with debug assertions, the code above will trigger a `attempt to subtract with overflow` panic before UB occurs. Other mistakes (e.g. using `EncParams` from a different key) may always trigger UB. Likely, older versions of this crate are also affected, but have not been tested.

GHSA-fq33-vmhv-48xh Affected ntru-rs has unsound FFI Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
ntru
crates.io
≥ 0.4.3
≤ 0.5.6

References

Frequently Asked Questions

What is GHSA-fq33-vmhv-48xh?
GHSA-fq33-vmhv-48xh is a security vulnerability in ntru-rs has unsound FFI involving Wrong API usage causes write past allocated area under General Security Weakness.
Which ntru-rs has unsound FFI versions are affected?
Affected versions include releases prior to current release patches across affected packages: ntru.
What version fixes GHSA-fq33-vmhv-48xh?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is ntru affected?
Yes, ntru is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-fq33-vmhv-48xh?
GHSA-fq33-vmhv-48xh is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-fq33-vmhv-48xh?
Run the dependency tree command: 'inspect dependencies for ntru'. 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-fq33-vmhv-48xh",
  "modified" : "2023-04-07T19:23:49Z",
  "published" : "2023-04-07T19:23:49Z",
  "aliases" : [ ],
  "summary" : "ntru-rs has unsound FFI: Wrong API usage causes write past allocated area",
  "details" : "The following usage causes undefined behavior.\n```rust\nlet kp: ntru::types::KeyPair = …;\nkp.get_public().export(Default::default())\n```\n\nWhen compiled with debug assertions, the code above will trigger a `attempt to subtract with overflow` panic before UB occurs.\nOther mistakes (e.g. using `EncParams` from a different key) may always trigger UB.\n\nLikely, older versions of this crate are also affected, but have not been tested.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "ntru"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.4.3"
      }, {
        "last_affected" : "0.5.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/FrinkGlobal/ntru-rs/issues/8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/FrinkGlobal/ntru-rs"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0032.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-04-07T19:23:49Z",
    "nvd_published_at" : null
  }
}