Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS01ODczLTZmd3EtNDYzZs4AA2oa

stellar-strkey vulnerable to panic in SignedPayload::from_payload

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

Permalink: https://github.com/advisories/GHSA-5873-6fwq-463f
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS01ODczLTZmd3EtNDYzZs4AA2oa
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 1 year ago
Updated: about 1 year ago


CVSS Score: 5.3
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Identifiers: GHSA-5873-6fwq-463f, CVE-2023-46135
References: Repository: https://github.com/stellar/rs-stellar-strkey
Blast Radius: 5.3

Affected Packages

cargo:stellar-strkey
Dependent packages: 20
Dependent repositories: 10
Downloads: 194,934 total
Affected Version Ranges: < 0.0.8
Fixed in: 0.0.8
All affected versions: 0.0.1, 0.0.2, 0.0.6, 0.0.7
All unaffected versions: 0.0.8, 0.0.9, 0.0.10, 0.0.11