CVE-2020-15999:Chrome Freetype字体库堆溢出漏洞通告

admin 2020年10月22日21:34:35评论128 views字数 2725阅读9分5秒阅读模式

CVE-2020-15999:Chrome Freetype字体库堆溢出漏洞通告

报告编号:B6-2020-102201

报告来源:360-CERT

报告作者:360-CERT

更新日期:2020-10-22

0x01 漏洞简述

2020年10月22日,360CERT监测发现 Google Chrome 发布了最新桌面版Chrome浏览器,版本86.0.4240.111,此次更新修复了5个安全漏洞,其中最为严重的为 CVE-2020-15999 ,漏洞等级: 高危 ,漏洞评分: 8.8 。

对此,360CERT建议广大用户及时将 Chrome 升级到最新版本。与此同时,请做好资产自查以及预防工作,以免遭受黑客攻击。

0x02 风险等级

360CERT对该漏洞的评定结果如下

评定方式 等级
威胁等级 高危
影响面 广泛
360CERT评分 8.8

0x03 漏洞信息

该漏洞由Google P0团队的安全研究员Sergei Glazunov 于10月19日发现,并且发现此前已有在野利用

该危害是由于FreeType 字体库存在堆溢出漏洞,FreeType官方于10月20日发布了2.10.4版本,修复了更新的5个漏洞,包括此漏洞。

漏洞存在于src/sfnt/pngshim.c:251 的 Load_SBit_Png 函数中:

FT_LOCAL_DEF( FT_Error )
Load_SBit_Png( FT_GlyphSlot slot,
FT_Int x_offset,
FT_Int y_offset,
FT_Int pix_bits,
TT_SBit_Metrics metrics,
FT_Memory memory,
FT_Byte* data,
FT_UInt png_len,
FT_Bool populate_map_and_metrics,
FT_Bool metrics_only )
{
[...]
png_get_IHDR( png, info,
&imgWidth, &imgHeight,
&bitdepth, &color_type, &interlace,
NULL, NULL ); // *** 1 ***
[...]
if ( populate_map_and_metrics )
{
metrics->width = (FT_UShort)imgWidth; // *** 2 ***
metrics->height = (FT_UShort)imgHeight;
map->width = metrics->width;
map->rows = metrics->height;
map->pixel_mode = FT_PIXEL_MODE_BGRA;
map->pitch = (int)( map->width * 4 );
[...]
if ( populate_map_and_metrics )
{
/* this doesn't overflow: 0x7FFF * 0x7FFF * 4 < 2^32 */
FT_ULong size = map->rows * (FT_ULong)map->pitch; // *** 3 ***
error = ft_glyphslot_alloc_bitmap( slot, size ); // *** 4 ***
if ( error )
goto DestroyExit;
}
[...]
png_read_image( png, rows ); // *** 5 ***

(1)处从header通过png_get_IHDR函数获取图像的width 和 height,都为32-bit整数

(2)处将获得的width 和 height 截断,取低16-bit存放在 TT_SBit_Metrics metrics 结构中

(3)处使用截断的值来计算位图的大小,

(4)处将(3)处计算得到的size来分配空间

(5)png_struct 传入png_read_image,由于png_struct 结构保存的值都是32-bit,因此截断值计算出来的空间无法匹配,造成堆溢出漏洞。

目前该漏洞的Poc文件已经公布。

0x04 补丁分析

diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
index 2e64e5846..7c98c2282 100644
--- a/src/sfnt/pngshim.c
+++ b/src/sfnt/pngshim.c
@@ -335,6 +335,11 @@
metrics->width = (FT_UShort)imgWidth;
metrics->height = (FT_UShort)imgHeight;
+ /* bail out if the width and/or height were truncated */
+ if ( metrics->width != imgWidth ||
+ metrics->height != imgHeight )
+ goto DestroyExit;
+
map->width = metrics->width;
map->rows = metrics->height;
map->pixel_mode = FT_PIXEL_MODE_BGRA;

补丁比较了width 和 height的原始值和截断后的值是否相同,如果不同,说明原始值已经大于0xffff,可能造成溢出,跳转到DestroyExit。

0x05 影响版本

< Chrome v86.0.4240.111

< FreeType 2.10.4

0x06 修复建议

Chrome 更新到最新版本v86.0.4240.111

FreeType 更新到最新版本2.10.4

0x07 时间线

2020-10-19 Sergei Glazunov 发现此漏洞

2020-10-20 FreeType发布最新2.10.4版本

2020-10-20 Chrome发布最新86.0.4240.111版本

2020-10-22 360CERT发布漏洞通告

0x08 参考链接

  1. https://thehackernews.com/2020/10/chrome-zeroday-attacks.html

  2. https://savannah.nongnu.org/bugs/?59308

  3. https://chromereleases.googleblog.com/2020/10/stable-channel-update-for-desktop_20.html

CVE-2020-15999:Chrome Freetype字体库堆溢出漏洞通告推荐阅读:

  1. 2020-10 补丁日:Oracle多个产品高危漏洞安全风险通告

  2. 安全事件周报 (10.12-10.18)

  3. CVE-2020-24407/24400:Adobe Magento 远程代码执行漏洞通告

长按下方二维码关注360CERT!谢谢你的关注!

CVE-2020-15999:Chrome Freetype字体库堆溢出漏洞通告

注:360CERT官方网站提供 《CVE-2020-15999:Chrome Freetype字体库堆溢出漏洞通告》 完整详情,点击阅读原文

本文始发于微信公众号(三六零CERT):CVE-2020-15999:Chrome Freetype字体库堆溢出漏洞通告

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2020年10月22日21:34:35
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CVE-2020-15999:Chrome Freetype字体库堆溢出漏洞通告http://cn-sec.com/archives/166857.html

发表评论

匿名网友 填写信息