A P-high unsoundness bug has been identified in the Rust borrow checker. This issue, which has existed for 11 years, allows for the circumvention of a struct's lifetime requirements through covariant field assignment. The Rust Types Team considers upholding memory safety a priority and is actively working on fixes.
The bug's mechanism involves assigning a value to a covariant field, which can then be accessed in a `Drop` implementation with an incorrect assumed lifetime. While the bug appears easy to trigger, exploiting it to cause memory unsafety requires an intentionally malicious `Drop` implementation. The provided code example demonstrates how the program compiles and prints unexpected output, leading to a stack-use-after-scope crash with AddressSanitizer.
Despite its age, the bug is rated P-high. The 'P-high' classification, rather than 'P-critical', is due to its long existence without being widely encountered, suggesting it is not easily triggered accidentally. The Rust team emphasizes that such bugs are taken seriously, regardless of real-world exploitation, and are part of ongoing efforts like Project Zero to minimize type system unsoundnesses.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
A P-high unsoundness bug, present for 11 years, was discovered in the Rust borrow checker. This bug allows bypassing struct's lifetime requirements via covariant field assignment, potentially leading to memory unsafety if exploited with a malicious `Drop` implementation.