GHSA-5873-6fwq-463f

Suggest an improvement
Source
https://github.com/advisories/GHSA-5873-6fwq-463f
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/10/GHSA-5873-6fwq-463f/GHSA-5873-6fwq-463f.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-5873-6fwq-463f
Aliases
Published
2023-10-25T14:09:10Z
Modified
2023-11-08T04:13:41.066082Z
Severity
  • 5.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L CVSS Calculator
Summary
stellar-strkey vulnerable to panic in SignedPayload::from_payload
Details

Impact

Panic vulnerability when a specially crafted payload is used. This is because of the following calculation:

inner_payload_len + (4 - inner_payload_len % 4) % 4

If inner_payload_len is 0xffffffff, (4 - inner_payload_len % 4) % 4 = 1 so

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

Database specific
{
    "nvd_published_at": "2023-10-25T18:17:36Z",
    "cwe_ids": [
        "CWE-248"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2023-10-25T14:09:10Z"
}
References

Affected packages

crates.io / stellar-strkey

Package

Name
stellar-strkey
View open source insights on deps.dev
Purl
pkg:cargo/stellar-strkey

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.0.8