Read the docs
TI-2023-30747 Aliases GHSA-87mf-9wg6-ppf8

Ouroboros is Unsound

Priority LOW 38Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
—
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub.

Summary

In 0.15.0 and prior, Ouroboros works internally by creating a struct where all uses of 'this are replaced by 'static. However, a recent addition to Miri checks that references passed to functions are valid during the entire execution of the function, even when those references are passed inside a struct. This poses an issue for dropping self-referencing values, as the reference becomes invalid during the dropping process. Effectively, since self-referencing structs are not allowed in vanilla Rust, there is no allowance for dropping data during a function that has also been given a reference to that data. There's usually no way to pass a and &a to the same function. A fix was attempted, where the struct would be turned in to a raw byte array and only transformed back into the underlying data type inside each function. This is allowable as a reference can be created and die over the body of a function, as long as the reference was created inside the function. However, this is also not sound if the original struct contains padding. There is no way to initialize padding bytes to a known value that Miri will accept, so when it is cast to an array some of the bytes contain uninitialized values. This is not acceptable (despite the fact that these bytes are never read) due to the potential for optimizations that may read from the uninitialized bytes. Besides which, this fix does not allow for template or constant parameters as there is no way to check the size of a templated type without giving specific, concrete values for the template parameters. The final solution was to use this fix while wrapping the raw byte array in MaybeUninit<>.

Why it matters now

Fix Fixed ouroboros (crates.io): 0.16.0

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—ouroboros (crates.io)before 0.16.00.16.0Patch availableGHSA-87mf-9wg6-ppf8
  • ouroboros (crates.io) Vendor— Affected before 0.16.0 Fixed in 0.16.0 Patch available GHSA-87mf-9wg6-ppf8

Remediation

  • Fix · GHSA-87mf-9wg6-ppf8 ouroboros (crates.io) Fixed in 0.16.0 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-87mf-9wg6-ppf8

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences