TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Remote Code Execution in ImageMagick (CVE-2016–3714)

30 点作者 jwise0大约 9 年前

3 条评论

asteadman大约 9 年前
I assume Lambda is affected? According to <a href="http:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;lambda&#x2F;latest&#x2F;dg&#x2F;current-supported-versions.html" rel="nofollow">http:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;lambda&#x2F;latest&#x2F;dg&#x2F;current-supporte...</a>, Lambda functions have access to ImageMagick-6.7.8.9. I&#x27;m not sure how you can specify a policy file in such an environment.
评论 #11627105 未加载
michaelmcmillan大约 9 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;ImageMagick&#x2F;ImageMagick&#x2F;commit&#x2F;e93e339c0a44cec16c08d78241f7aa3754485004" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ImageMagick&#x2F;ImageMagick&#x2F;commit&#x2F;e93e339c0a...</a>
评论 #11623529 未加载
chatmasta大约 9 年前
The article doesn&#x27;t reveal much, but judging from the list of vulnerable coders and the fact that the Imagemagick forum post references the delegates.xml file, I imagine the exploit allows users to create their own delegate [0], then upload an image that causes that delegate to be called. My guess is that the exploit is two parts: 1) appending a line to the delegates.xml file by exploiting a vulnerable coder, and 2) exploiting the custom delegate you create.<p>Delegates seem very dangerous and there&#x27;s all sorts of ways to exploit a custom delegate.<p>I&#x27;m surprised we haven&#x27;t seen more Imagemagick vulnerabilities... it&#x27;s a really old library with a massive codebase supporting tons of file formats and arbitrary command chaining. And it&#x27;s often called by higher level languages via functions like `system()` or `shell()` where developers could easily neglect to &quot;properly sanitize&quot; user inputs, since what those &quot;inputs&quot; can be is so wide ranging.<p>[0] <a href="http:&#x2F;&#x2F;www.imagemagick.org&#x2F;Usage&#x2F;files&#x2F;#delegates" rel="nofollow">http:&#x2F;&#x2F;www.imagemagick.org&#x2F;Usage&#x2F;files&#x2F;#delegates</a><p>EDIT:<p>Looks like I was right... check out this commit from 3 days ago:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ImageMagick&#x2F;ImageMagick&#x2F;commit&#x2F;06c41aba39b97203f6b9a0be6a2ccf8888cddc93" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ImageMagick&#x2F;ImageMagick&#x2F;commit&#x2F;06c41aba39...</a><p>&quot;Sanitize input filename for http &#x2F; https delegates&quot;<p>So presumably the attack is to set the &quot;filename&quot; property of a file such that when including &#x27;%f&#x27; in a command, the filename breaks the shell command and inserts its own arbitrary code.<p>EDIT 2:<p>A reddit user also linked to this critical line: <a href="https:&#x2F;&#x2F;github.com&#x2F;ImageMagick&#x2F;ImageMagick&#x2F;blob&#x2F;e93e339c0a44cec16c08d78241f7aa3754485004&#x2F;MagickCore&#x2F;delegate.c#L99" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ImageMagick&#x2F;ImageMagick&#x2F;blob&#x2F;e93e339c0a44...</a><p>So the process would be something like this:<p>1) Create file with name e.g. evilserver.com&#x2F;funnycat&#x27;;rm-rf&#x2F;;.gif hosted on remote server<p>2) Somehow instruct vulnerable imagemagick install to download evilserver.com&#x2F;funnycat&#x27;;rm-rf&#x2F;;.gif<p>3) Assume 99% chance that the render command on server will include %f, which is unsanitized, and will cause rm -rf &#x2F; to execute<p>I&#x27;m a bit confused on step (2)... how do you tell imagemagick to download a file? Will this only affect installations that are explicitly downloading untrusted URLs from users? Like if imgur &quot;upload via URL&quot; fed the URL directly to imagemagick, it would be vulnerable...