您的位置 首页 php

PHP GD库最新漏洞,可令CPU使用率瞬间飙升至100%!

前几天,PHP出现一个代号为PHP CVE-2018-5711的漏洞,只要是使用GD库处理图像的站点基本上会中招。想到公司内部有部分业务正是使用PHP开发的,故而对这个漏洞稍微研究了一下。

漏洞执行过程

PHP GD库最新漏洞,可令CPU使用率瞬间飙升至100%!

也就是说,使用imagecreatefromgif函数时可能触发该漏洞,导致CPU使用率飙升至100%。目前,该漏洞影响了几乎所有的PHP版本:

  • PHP 5 < 5.6.33

  • PHP 7.0 < 7.0.27

  • PHP 7.1 < 7.1.13

  • PHP 7.2 < 7.2.1

当然,大家不要轻易去尝试,毕竟乱搞是违法的行为,研究时记得在自己 虚拟机 中还原这一过程就可以了。

漏洞出现原因

出现漏洞的文件为ext/gd/libgd/gd_gif_in.c中代码:

PHP GD库最新漏洞,可令CPU使用率瞬间飙升至100%!

PHP GD库最新漏洞,可令CPU使用率瞬间飙升至100%!

GetCode会调用GetDataBlock函数读取GIF图中的数据。

PHP GD库最新漏洞,可令CPU使用率瞬间飙升至100%!

细心的人也许已经发现端倪了,其实是变量类型转换引起的。

当GetDataBlock返回值为-1时,第二段代码中的count值无法赋上该值,所有bug就出现了。

最后,提醒一下广大开发者和运维兄弟,及时更新扩展,防止出现服务器挂掉的情况!

文章来源:智云一二三科技

文章标题:PHP GD库最新漏洞,可令CPU使用率瞬间飙升至100%!

文章地址:https://www.zhihuclub.com/151284.shtml

关于作者: 智云科技

热门文章

评论已关闭

9条评论

  1. It also stimulates aldosterone secretion by theadrenal cortex I remember I tried going for a walk with my friend and it was two days after my chemo treatments

  2. The metabolism of this drug is subject to genetic polymorphisms Blood was processed within 2 h of collection

  3. Christian took a private lesson with Jonathan Doty and was very happy with the skills he built in two hours

  4. Mild irritation of the eyes and the lining of the mouth and throat, and inflammation of the bladder may occur Each chromosome has a short arm designated p and a long arm designated q

  5. cialis buy bactrim baikal pharmacy Investment banking was a second strong suit for JPMorgan

  6. We further excluded those with missing data for calculating EEE n 98, HRT users n 87, and those without at least one follow up n 92

  7. I am also thinking about taking the 50mg days 3- 7 instead of 5- 9 since it is my last month being able to take it according to my OB

  8. viagra feldene fiale generico prezzo LONDON AP Гў Satellite images have laid bare the suffering inflicted on Syria s largest city, a London based rights group said Wednesday, cataloguing hundreds of damaged or destroyed houses and more than 1, 000 roadblocks

  9. Introduction Obesity related metabolic abnormalities occur from a very young age and it is directly related to the fat content of the body

网站地图