CVE-2026-29795: stellar-xdr's StringM :from_str Bypasses Max Length Validation Vulnerability
MODERATECVE-2026-29795 is a MODERATE (CVSS 4.0) :from_str bypasses max length validation vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting stellar-xdr's StringM libraries in the crates.io ecosystem. The issue involves :from_str bypasses max length validation. Remediation is available by upgrading affected packages to version 25.0.1.
CVE-2026-29795 at a Glance
Security Impact
CVSS: 4.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).
How to Fix CVE-2026-29795
To remediate this vulnerability, upgrade all affected stellar-xdr's StringM dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade stellar-xdr to 25.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for stellar-xdr
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-29795, inspect your project dependencies for stellar-xdr's StringM:
inspect dependencies for stellar-xdr
Analyze the terminal output to locate any version of stellar-xdr's StringM in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 25.0.1), 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In stellar-xdr's StringM, 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
CVE-2026-29795 Affected stellar-xdr's StringM Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
stellar-xdr
|
crates.io |
< 25.0.1
|
25.0.1
|
References
Frequently Asked Questions
What is CVE-2026-29795?
Which stellar-xdr's StringM versions are affected?
What version fixes CVE-2026-29795?
Is stellar-xdr affected?
What is the CVSS score of CVE-2026-29795?
What CWE is associated with CVE-2026-29795?
How can I check crates.io dependencies for CVE-2026-29795?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x57h-xx53-v53w",
"modified" : "2026-03-06T22:51:52Z",
"published" : "2026-03-05T20:45:46Z",
"aliases" : [ "CVE-2026-29795" ],
"summary" : "stellar-xdr's StringM::from_str bypasses max length validation",
"details" : "### Impact\n\n`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.\n\nThis 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.\n\nAll published versions of the `stellar-xdr` crate up to and including `v25.0.0` are affected.\n\n### Patches\n\nThe fix is merged in [#500](https://github.com/stellar/rs-stellar-xdr/pull/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`.\n\nUsers should upgrade to the first release containing this fix once published (the next release after `v25.0.0`).\n\n### Workarounds\n\nValidate 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.\n\n### References\n\n- Issue: https://github.com/stellar/rs-stellar-xdr/issues/499\n- Fix: https://github.com/stellar/rs-stellar-xdr/pull/500",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "stellar-xdr"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "25.0.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 25.0.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/stellar/rs-stellar-xdr/security/advisories/GHSA-x57h-xx53-v53w"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-29795"
}, {
"type" : "WEB",
"url" : "https://github.com/stellar/rs-stellar-xdr/issues/499"
}, {
"type" : "WEB",
"url" : "https://github.com/stellar/rs-stellar-xdr/pull/500"
}, {
"type" : "WEB",
"url" : "https://github.com/stellar/rs-stellar-xdr/commit/1f840013c3e2fca0321fb844b048afa01d10dda6"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/stellar/rs-stellar-xdr"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-05T20:45:46Z",
"nvd_published_at" : "2026-03-06T21:16:15Z"
}
}