CVE-2023-46135: Stellar strkey :from_payload Vulnerability

MODERATE
Advisory Identifier: GHSA-5873-6fwq-463f
CVSS 5.3
CWE-248
Published
Advisory Summary

CVE-2023-46135 is a MODERATE (CVSS 5.3) :from_payload vulnerability (CWE-248: Uncaught Exception) affecting Stellar strkey libraries in the crates.io ecosystem. The issue involves :from_payload. Remediation is available by upgrading affected packages to version 0.0.8.

CVE-2023-46135 at a Glance

CVE Identifier CVE-2023-46135
GHSA Identifier GHSA-5873-6fwq-463f
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-248: Uncaught Exception
Affected Product Stellar strkey
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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

How to Fix CVE-2023-46135

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

stellar-strkey fixed: 0.0.8
Upgrade stellar-strkey to 0.0.8
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 stellar-strkey

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-46135, inspect your project dependencies for Stellar strkey:

inspect dependencies for stellar-strkey

Analyze the terminal output to locate any version of Stellar strkey in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.8), 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-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Stellar strkey, 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 Panic vulnerability when a specially crafted payload is used. This is because of the following calculation: ```rust inner_payload_len + (4 - inner_payload_len % 4) % 4 ``` If `inner_payload_len` is `0xffffffff`, `(4 - inner_payload_len % 4) % 4 = 1` so ```rust inner_payload_len + (4 - inner_payload_len % 4) % 4 = u32::MAX + 1 ``` which overflow. ### Patches Check that `inner_payload_len` is not above 64 which should never be the case. Patched in version 0.0.8 ### Workarounds Sanitize input payload before it is passed to the vulnerable function so that bytes in `payload[32..32+4]` and parsed as a `u32` is not above 64. ### References GitHub issue #58

CVE-2023-46135 Affected Stellar strkey Versions

1 component(s)
Fixed Versions:
0.0.8
Product / Package Ecosystem Affected Versions Fixed Version
stellar-strkey
crates.io
< 0.0.8
0.0.8

References

Frequently Asked Questions

What is CVE-2023-46135?
CVE-2023-46135 is a security vulnerability in Stellar strkey involving :from_payload under CWE-248: Uncaught Exception.
Which Stellar strkey versions are affected?
Affected versions include releases prior to 0.0.8 across affected packages: stellar-strkey.
What version fixes CVE-2023-46135?
Upgrading to 0.0.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is stellar-strkey affected?
Yes, stellar-strkey is affected in releases prior to 0.0.8. Upgrade your dependency to 0.0.8 or later.
What is the CVSS score of CVE-2023-46135?
CVE-2023-46135 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2023-46135?
CVE-2023-46135 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check crates.io dependencies for CVE-2023-46135?
Run the dependency tree command: 'inspect dependencies for stellar-strkey'. 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-5873-6fwq-463f",
  "modified" : "2023-10-25T14:09:10Z",
  "published" : "2023-10-25T14:09:10Z",
  "aliases" : [ "CVE-2023-46135" ],
  "summary" : "stellar-strkey vulnerable to panic in SignedPayload::from_payload",
  "details" : "### Impact\nPanic vulnerability when a specially crafted payload is used. \nThis is because of the following calculation:\n```rust\ninner_payload_len + (4 - inner_payload_len % 4) % 4\n```\nIf `inner_payload_len` is `0xffffffff`, `(4 - inner_payload_len % 4) % 4 = 1` so\n```rust\ninner_payload_len + (4 - inner_payload_len % 4) % 4 = u32::MAX + 1\n```\nwhich overflow.\n\n### Patches\nCheck that `inner_payload_len` is not above 64 which should never be the case.\nPatched in version 0.0.8\n\n### Workarounds\nSanitize input payload before it is passed to the vulnerable function so that bytes in `payload[32..32+4]` and parsed as a `u32` is not above 64.\n\n### References\nGitHub issue #58\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "stellar-strkey"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-stellar-strkey/security/advisories/GHSA-5873-6fwq-463f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-46135"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-stellar-strkey/issues/58"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-stellar-strkey/pull/59"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-stellar-strkey/commit/83adad0f5b1cda693c7ba8524d395add8077865f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/stellar/rs-stellar-strkey"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-stellar-strkey/releases/tag/v0.0.8"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-25T14:09:10Z",
    "nvd_published_at" : "2023-10-25T18:17:36Z"
  }
}