You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit destabilizes the Error::type_id function in the standard library.
This does so by effectively reverting #58048, restoring the #[unstable]
attribute. The security mailing list has recently been notified of a
vulnerability relating to the stabilization of this function. First stabilized
in Rust 1.34.0, a stable function here allows users to implement a custom
return value for this function:
struct MyType;
impl Error for MyType {
fn type_id(&self) -> TypeId {
// Enable safe casting to `String` by accident.
TypeId::of::<String>()
}
}
This, when combined with the Error::downcast family of functions, allows
safely casting a type to any other type, clearly a memory safety issue! A
formal announcement has been made to the security mailing list as well as the blog
This commit simply destabilizes the Error::type_id which, although breaking
for users since Rust 1.34.0, is hoped to have little impact and has been deemed
sufficient to mitigate this issue for the stable channel. The long-term fate of
the Error::type_id API will be discussed at #60784.
🔍 The webpage content is not accessible, but the pull request context indicates that the Error::type_id function is being destabilized due to a security vulnerability related to allowing custom return values.
🔍 This commit destabilizes the Error::type_id function due to a security vulnerability that allows users to implement a custom return value for the function, enabling type confusion attacks.
🔍 The security vulnerability arises because stabilizing Error::type_id allows user-defined types to return arbitrary TypeId values, enabling type confusion attacks by bypassing the compiler's type safety guarantees.
🔍 The Error::type_id function is being destabilized because its stable implementation allows users to return arbitrary TypeId values, enabling type confusion vulnerabilities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit destabilizes the
Error::type_idfunction in the standard library.This does so by effectively reverting #58048, restoring the
#[unstable]attribute. The security mailing list has recently been notified of a
vulnerability relating to the stabilization of this function. First stabilized
in Rust 1.34.0, a stable function here allows users to implement a custom
return value for this function:
This, when combined with the
Error::downcastfamily of functions, allowssafely casting a type to any other type, clearly a memory safety issue! A
formal announcement has been made to the security mailing list as well as the blog
This commit simply destabilizes the
Error::type_idwhich, although breakingfor users since Rust 1.34.0, is hoped to have little impact and has been deemed
sufficient to mitigate this issue for the stable channel. The long-term fate of
the
Error::type_idAPI will be discussed at #60784.