# CVE-2026-29795: stellar-xdr: `StringM::from_str` bypasses max length validation

> The stellar-xdr library fails to enforce maximum length limits on strings, allowing oversized data to bypass validation and potentially corrupt downstream logic.

- **Severity:** Medium 4.0 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Mar 2026
- **Updated:** 9 Mar 2026
- **Also known as:** GHSA-x57h-xx53-v53w

## What is CVE-2026-29795?

CVE-2026-29795 is a medium-severity vulnerability in rs-stellar-xdr, published on 6 Mar 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

stellar-xdr is a library and CLI containing types and functionality for working with Stellar XDR. Prior to version 25.0.1, 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. This issue has been patched in version 25.0.1.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling)

## Which versions are affected by CVE-2026-29795?

2 open source packages ship an affected version, including stellar-xdr. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `stellar-xdr` | crates.io | All versions | 25.0.1 |
| `stellar-xdr` | crates.io | All versions | 25.0.1 |

Products: Stellar Stellar-Xdr.

## How do I fix CVE-2026-29795?

Upgrade stellar-xdr to 25.0.1 or later.

## Is CVE-2026-29795 being exploited?

There is no known exploitation of CVE-2026-29795 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-29795 and fix it if it is affected.

What it is: CVE-2026-29795 is a medium-severity vulnerability in rs-stellar-xdr, published on 6 Mar 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-29795 in the wild and no public exploit code.

Affected packages and fixed versions:
- stellar-xdr (crates.io): affected all versions; fixed in 25.0.1
- stellar-xdr (crates.io): affected all versions; fixed in 25.0.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-29795/ (Markdown: https://insights.sbomify.com/CVE-2026-29795/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-29795
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-29795
- OSV: https://osv.dev/vulnerability/CVE-2026-29795

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-29795/
Summaries are generated and may contain mistakes; the official description above is the record.
