TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Security advisory for crates.io

40 pointsby aurhumover 7 years ago

5 comments

tetraodonpufferover 7 years ago
the response time of the rust team was extremely quick, great job!<p>2017-09-13 @ 19:19 - Justin sends mail to security@rust-lang.org about this<p>2017-09-13 @ 19:28 - response sent to Justin acknowledging the vulnerability<p>2017-09-13 @ 21:14 - a patch to crates.io was finished, all current tarballs verified not-malicious
评论 #15289131 未加载
评论 #15289177 未加载
steveklabnikover 7 years ago
As always: there are no silver bullets. Static typing, nor Rust, can save you from all bugs.<p>If you follow the link to the security announcement list, you can see the one other advisory we&#x27;ve had since 1.0 as well.
评论 #15289144 未加载
benmmurphyover 7 years ago
the second &#x27;precaution&#x27; fix looks actually important because it stops an archive from a following a symlink it creates that would allow it to write outside of the package directory. my thoughts are:<p>before the precaution fix this was a legal archive:<p><pre><code> $crate_name-$crate_version&#x2F;outside -&gt; ..&#x2F; $crate_name-$crate_version&#x2F;outside&#x2F;$other_crate-$other-version&#x2F;blah&#x2F;blah </code></pre> then you have this code:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;cargo&#x2F;pull&#x2F;4493&#x2F;files#diff-ce3ac564b3688633fe9c7ccb934e6253L316" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;cargo&#x2F;pull&#x2F;4493&#x2F;files#diff-ce3a...</a><p><pre><code> tar.unpack(dst.parent().unwrap())?; </code></pre> so while Archive#unpack protects you against following symlinks outside of `dst` (which is a really good default!) it doesn&#x27;t protect you from following symlinks inside of `dst` so presumably you can use the symlink trick to overwrite other packages.<p>i haven&#x27;t tested this so this could be wrong :&#x2F; like maybe archive by default doesn&#x27;t create symlinks or reorders the extraction so symlinks are always created last.
majewskyover 7 years ago
I cannot read this security advisory because I don&#x27;t allow third-party JS. No punchline.
评论 #15288980 未加载
jacquesmover 7 years ago
Why is it that people are still writing code in languages such as Rust when we have much better alternatives such as C. In C this bug would have never happened. ;)