CVE-2017-1000168: Sodiumoxide Scalarmult() Vulnerable To Degenerate Public Vulnerability

MODERATE
Advisory Identifier: GHSA-2wc6-2rcj-8v76
CVSS 6.5
CWE-1240
Published
Advisory Summary

CVE-2017-1000168 is a MODERATE (CVSS 6.5) scalarmult() vulnerable to degenerate public vulnerability (CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation) affecting Sodiumoxide libraries in the crates.io ecosystem. The issue involves scalarmult() vulnerable to degenerate public keys. Remediation is available by upgrading affected packages to version 0.0.14.

CVE-2017-1000168 at a Glance

CVE Identifier CVE-2017-1000168
GHSA Identifier GHSA-2wc6-2rcj-8v76
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation
Affected Product Sodiumoxide
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2017-1000168

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

sodiumoxide fixed: 0.0.14
Upgrade sodiumoxide to 0.0.14
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 sodiumoxide

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-1000168, inspect your project dependencies for Sodiumoxide:

inspect dependencies for sodiumoxide

Analyze the terminal output to locate any version of Sodiumoxide in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.14), 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-1240: Use of a Cryptographic Primitive with a Risky Implementation, where 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. In Sodiumoxide, 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 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.

CVE-2017-1000168 Affected Sodiumoxide Versions

1 component(s)
Fixed Versions:
0.0.14
Product / Package Ecosystem Affected Versions Fixed Version
sodiumoxide
crates.io
< 0.0.14
0.0.14

References

Frequently Asked Questions

What is CVE-2017-1000168?
CVE-2017-1000168 is a security vulnerability in Sodiumoxide involving scalarmult() vulnerable to degenerate public keys under CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation.
Which Sodiumoxide versions are affected?
Affected versions include releases prior to 0.0.14 across affected packages: sodiumoxide.
What version fixes CVE-2017-1000168?
Upgrading to 0.0.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sodiumoxide affected?
Yes, sodiumoxide is affected in releases prior to 0.0.14. Upgrade your dependency to 0.0.14 or later.
What is the CVSS score of CVE-2017-1000168?
CVE-2017-1000168 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2017-1000168?
CVE-2017-1000168 is classified under CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation (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.).
How can I check crates.io dependencies for CVE-2017-1000168?
Run the dependency tree command: 'inspect dependencies for sodiumoxide'. 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-2wc6-2rcj-8v76",
  "modified" : "2023-06-13T20:56:05Z",
  "published" : "2021-08-25T21:00:41Z",
  "aliases" : [ "CVE-2017-1000168" ],
  "summary" : "scalarmult() vulnerable to degenerate public keys",
  "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "sodiumoxide"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.14"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1240" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-05T21:10:47Z",
    "nvd_published_at" : null
  }
}