{"id":"CVE-2026-29795","aliases":["CVE-2026-29795","GHSA-x57h-xx53-v53w"],"related":[],"kind":"vulnerability","state":"published","title":"stellar-xdr: `StringM::from_str` bypasses max length validation","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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","format":"markdown","source":"ghsa"},{"lang":"es","text":"stellar-xdr es una librería y CLI que contiene tipos y funcionalidades para trabajar con Stellar XDR. Antes de la versión 25.0.1, StringM::from_str no valida que la longitud de entrada esté dentro del máximo declarado (MAX). Llamar a StringM::::from_str(s) donde s es más largo que N bytes tiene éxito y devuelve un valor Ok en lugar de Err(Error::LengthExceedsMax), produciendo un StringM que viola su invariante de longitud. Esto afecta a cualquier código que construye valores StringM a partir de una entrada de cadena usando FromStr (incluyendo str::parse), y que depende de que se aplique la restricción de longitud máxima del tipo. Un StringM sobredimensionado podría propagarse a través de la serialización, la validación u otra lógica que asume que el invariante se mantiene. Este problema ha sido parcheado en la versión 25.0.1.","source":"nvd"}],"published":"2026-03-05T20:45:46.000Z","modified":"2026-06-17T10:29:54.127Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":4,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"< 25.0.1","status":"affected"}],"vendor":"stellar","product":"rs-stellar-xdr","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"25.0.1"}],"ecosystem":"crates.io","package":"stellar-xdr","purl":"pkg:cargo/stellar-xdr","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"25.0.1"}],"vendor":"stellar","product":"stellar-xdr","cpe":"cpe:2.3:a:stellar:stellar-xdr:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/stellar/rs-stellar-xdr/security/advisories/GHSA-x57h-xx53-v53w","tags":["mitigation","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/stellar/rs-stellar-xdr/issues/499","tags":["issue-tracking","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/stellar/rs-stellar-xdr/pull/500","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/stellar/rs-stellar-xdr/commit/1f840013c3e2fca0321fb844b048afa01d10dda6","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-29795","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/stellar/rs-stellar-xdr","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-03-09T20:49:57.353Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-29795","url":"https://www.cve.org/CVERecord?id=CVE-2026-29795","licence":"CVE Terms of Use","modified":"2026-03-09T20:54:30.156Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-x57h-xx53-v53w","url":"https://github.com/advisories/GHSA-x57h-xx53-v53w","licence":"CC-BY-4.0","modified":"2026-03-06T23:02:40.557Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-29795","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-29795","licence":"Public domain","modified":"2026-06-17T10:29:54.127Z"}],"updatedAt":"2026-11-25T22:59:15.422Z","epss":{"score":0.00229,"percentile":0.14658,"date":"2026-12-02T12:00:21.000Z"}}