summary refs log tree commit diff
path: root/RELEASES.md
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-05-13 20:18:57 +0000
committerbors <bors@rust-lang.org>2019-05-13 20:18:57 +0000
commit6c2484dc3c532c052f159264e970278d8b77cdc9 (patch)
treed04523d647584bae0a5990714cdc5bae655ae785 /RELEASES.md
parentfc50f328b0353b285421b8ff5d4100966387a997 (diff)
parentbc8787c998d8c4f411193733086954fb884e8470 (diff)
downloadrust-1.34.2.tar.gz
rust-1.34.2.zip
Auto merge of #60785 - alexcrichton:error-type-id-destabilize-stable, r=pietroalbini 1.34.2
[stable] Destabilize the `Error::type_id` function

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](https://groups.google.com/forum/#!topic/rustlang-security-announcements/aZabeCMUv70) as well as [the blog](https://blog.rust-lang.org/2019/05/13/Security-advisory.html)

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.
Diffstat (limited to 'RELEASES.md')
-rw-r--r--RELEASES.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/RELEASES.md b/RELEASES.md
index 3b4f4182702..48bd13105bb 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,3 +1,11 @@
+Version 1.34.2 (2019-05-14)
+===========================
+
+* [Destabilize the `Error::type_id` function due to a security
+   vulnerability][60785]
+
+[60785]: https://github.com/rust-lang/rust/pull/60785
+
 Version 1.34.1 (2019-04-25)
 ===========================