Open-Source Security Intelligence

Know every vulnerability
before it knows you.

DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.

Search

GHSA-x57h-xx53-v53w

MediumCVSS 4 / 10
Published Mar 5, 2026·Last modified Mar 6, 2026
Affected Components(0)

No affected components available

Description

Impact

StringM::from_str does not validate that the input length is within the declared maximum (MAX). Calling StringM::<N>::from_str(s) where s is longer than N bytes succeeds and returns an Ok value instead of Err(Error::LengthExceedsMax), producing a StringM that violates its length invariant.

This affects any code that constructs StringM values from string input using FromStr (including str::parse), and relies on the type's maximum length constraint being enforced. An oversized StringM could propagate through serialization, validation, or other logic that assumes the invariant holds.

All published versions of the stellar-xdr crate up to and including v25.0.0 are affected.

Patches

The fix is merged in #500. It replaces the direct Ok(Self(b)) construction with b.try_into(), which routes through TryFrom<Vec<u8>> and properly validates the length — matching the pattern already used by BytesM::from_str.

Users should upgrade to the first release containing this fix once published (the next release after v25.0.0).

Workarounds

Validate the byte length of string input before calling StringM::from_str, or construct StringM values via StringM::try_from(s.as_bytes().to_vec()) which correctly enforces the length constraint.

References

  • Issue: https://github.com/stellar/rs-stellar-xdr/issues/499
  • Fix: https://github.com/stellar/rs-stellar-xdr/pull/500
Risk Scores
Base Score
4.0

The vulnerability requires local access to the device to be exploited. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. No user interaction is needed for the attacker to exploit this vulnerability. The impact is confined to the system where the vulnerability exists. There is a low impact on the integrity of the data.

Threat Intelligence
3.7

Limited exploitation activity has been observed. Close monitoring and planned remediation are recommended.

EPSS
0.19%

The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.

Exploit
Not available

We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.

Browse More

Scan your project

Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.

Checkout DevGuard