Bug 1597063 (CVE-2018-1000622)

Summary: CVE-2018-1000622 rust: rustdoc loads plugins from world writable directory allowing for arbitrary code execution
Product: [Other] Security Response Reporter: Sam Fowler <sfowler>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bodavis, fweimer, igor.raits, jistone, jpadman, lkundrak, mnewsome, rust-sig, security-response-team, sfowler, TicoTimo
Target Milestone: ---Keywords: Reopened, Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rust 1.27.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-10 19:13:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1599103, 1599104, 1599904, 1881812    
Bug Blocks: 1597064    

Description Sam Fowler 2018-07-02 00:51:25 UTC
rustdoc in versions of Rust through 1.26 loads plugins by default from the world writable directory, /tmp/rustdoc/plugins/. An attacker could exploit this by writing a malicious library to this directory allowing for invocations of rustdoc to execute arbitrary code.

Comment 2 Josh Stone 2018-07-02 16:27:47 UTC
IMO this has low impact.  rustdoc will only load external libraries if given the --plugins option, and /tmp/rustdoc/plugins/ is only used if not given a --plugin-path.  Both of these plugin options are deprecated and print warnings as such when you use them.

    $ rustdoc foo/src/lib.rs --plugin-path /dev/null
    WARNING: the 'plugin-path' flag is considered deprecated
    WARNING: please see https://github.com/rust-lang/rust/issues/44136

Comment 4 Sam Fowler 2018-07-08 23:51:24 UTC
Acknowledgments:

Name: Lubomir Rintel (Red Hat)

Comment 5 Sam Fowler 2018-07-08 23:51:55 UTC
Created rust tracking bugs for this issue:

Affects: epel-7 [bug 1599104]
Affects: fedora-all [bug 1599103]

Comment 7 Josh Stone 2018-08-03 14:27:55 UTC
Igor, why did you close this?  Bug 1599104 for epel7 is still in testing.
(long bodhi time to stable, and I accidentally reset it with 1.27.2)

Comment 8 Josh Stone 2018-08-10 19:13:59 UTC
Now epel7 is on stable too.

Comment 10 Marco Benatto 2020-04-07 21:03:31 UTC
The rust version shipped by Developers Toolset on Red Hat Enterprise Linux is affected by this issue.
The fix was made available through the following errata:
https://access.redhat.com/errata/RHEA-2018:3584