CVE-2018-3639 & CVE-2018-3640:CPU SSB/RSRE 漏洞预警
2018-05-22 14:08

enter image description here

报告编号: B6-2018-052201

报告来源: 360-CERT

报告作者: 360-CERT

更新日期: 2018-05-22

0x00 漏洞概述

2018年5月21日,微软官方公布新CPU漏洞--Speculative Store Bypass (SSB)漏洞细节,属于日前预警的Spectre-NG的其中一个( Variant 4),由MSRC团队的Ken Johnson和Google Project Zero团队的Jann Horn共同发现,漏洞编号为CVE-2018-3639,目前Google Project Zero团队已公布相关poc代码,攻击者能通过v4拿到cpu或内存中的旧有内容。

同时,另一个CPU漏洞--Rogue System Register Read (RSRE)也被披露,属于Spectre-NG中的Variant 3a,漏洞编号为CVE-2018-3640。

360-CERT团队经过评估,认为漏洞风险等级重要,建议进行谨慎评估后更新。

0x01 漏洞影响面

AMD,ARM,Intel厂商的CPU分别受到不同程度的影响

目前,

  • 微软在年初发布的针对Spectre and Meltdown漏洞的安全更新对此漏洞有一定的缓解。
  • 主流浏览器厂商,Intel, RedHat, Xen等各家基础服务提供商也提供了相应的缓解措施。

Intel提供的受影响处理器列表:

  • Intel® Core™ i3 processor (45nm and 32nm)
  • Intel® Core™ i5 processor (45nm and 32nm)
  • Intel® Core™ i7 processor (45nm and 32nm)
  • Intel® Core™ M processor family (45nm and 32nm)
  • 2nd generation Intel® Core™ processors
  • 3rd generation Intel® Core™ processors
  • 4th generation Intel® Core™ processors
  • 5th generation Intel® Core™ processors
  • 6th generation Intel® Core™ processors
  • 7th generation Intel® Core™ processors
  • 8th generation Intel® Core™ processors
  • Intel® Core™ X-series Processor Family for Intel® X99 platforms
  • Intel® Core™ X-series Processor Family for Intel® X299 platforms
  • Intel® Xeon® processor 3400 series
  • Intel® Xeon® processor 3600 series
  • Intel® Xeon® processor 5500 series
  • Intel® Xeon® processor 5600 series
  • Intel® Xeon® processor 6500 series
  • Intel® Xeon® processor 7500 series
  • Intel® Xeon® Processor E3 Family
  • Intel® Xeon® Processor E3 v2 Family
  • Intel® Xeon® Processor E3 v3 Family
  • Intel® Xeon® Processor E3 v4 Family
  • Intel® Xeon® Processor E3 v5 Family
  • Intel® Xeon® Processor E3 v6 Family
  • Intel® Xeon® Processor E5 Family
  • Intel® Xeon® Processor E5 v2 Family
  • Intel® Xeon® Processor E5 v3 Family
  • Intel® Xeon® Processor E5 v4 Family
  • Intel® Xeon® Processor E7 Family
  • Intel® Xeon® Processor E7 v2 Family
  • Intel® Xeon® Processor E7 v3 Family
  • Intel® Xeon® Processor E7 v4 Family
  • Intel® Xeon® Processor Scalable Family
  • Intel® Atom™ Processor C Series (C3308, C3338, C3508, C3538, C3558, C3708, C3750, C3758, C3808, C3830, C3850, C3858, C3950, C3955, C3958)
  • Intel® Atom™ Processor E Series
  • Intel® Atom™ Processor A Series
  • Intel® Atom™ Processor X Series (x5-E3930, x5-E3940, x7-E3950)
  • Intel® Atom™ Processor T Series (T5500, T5700)
  • Intel® Atom™ Processor Z Series
  • Intel® Celeron® Processor J Series (J3355, J3455, J4005, J4105)
  • Intel® Celeron® Processor N Series (N3450)
  • Intel® Pentium® Processor J Series (J4205)
  • Intel® Pentium® Processor N Series (N4000, N4100, N4200)
  • Intel® Pentium® Processor Silver Series (J5005, N5000)

0x02 漏洞细节

Speculative Store Bypass (SSB)--CVE-2018-3639漏洞细节,攻击者能通过v4拿到cpu或内存中的旧有内容,漏洞可能发生在如下场景:

01: 88040F            mov [rdi+rcx],al
02: 4C0FB6040E        movzx r8,byte [rsi+rcx]
03: 49C1E00C          shl r8,byte 0xc
04: 428B0402          mov eax,[rdx+r8]

如果RDI和RSI指向的是同一个地址,则假设第1行中的MOV指令在特殊情况下可能需要额外的时间来执行( 如果计算RDI+RCX的地址表达式正在等待先前的指令执行)。在这种情况下,CPU可能会预测MOVZX不依赖于MOV,并且可以在执行保存AL数据的MOV之前进行预测执行。这可能会导致位于RSI+RCX的内存中的旧数据被加载到R8中,从而导致第四行代码使用了错误的数据。

该漏洞适用的攻击场景如下:

alt

Poc的运行效果如下:

alt

alt

Rogue System Register Read (RSRE)--CVE-2018-3640漏洞:

该漏洞允许应用层权限的攻击者通过预测执行和侧信道攻击来获取系统参数和系统敏感信息。

0x03 缓解措施

针对Speculative Store Bypass (SSB)--CVE-2018-3639的缓解措施:

  1. 利用序列化指令(例如x86/x64上的LFENCE 和 ARM上的SSBB指令)来屏蔽预测执行,缓解SSB漏洞

  2. 升级微码或固件在硬件方面修补该漏洞

  3. 对于CVE-2017-5753 (Spectre variant 1)漏洞的缓解措施同样适用于该漏洞

  4. 升级主流浏览器到最新版(360安全浏览器,Firefox,Chrome,Edge 等)

其他缓解措施对该漏洞的影响:

alt

0x04 时间线

2018-05-07 360CERT发布《Spectre-NG:多个新CPU漏洞预警》

2018-05-21 CVE-2018-3639 & CVE-2018-3640漏洞被公布

2018-05-22 360CERT发布CVE-2018-3639 & CVE-2018-3640漏洞预警通告

0x05 参考链接

  1. https://blogs.technet.microsoft.com/srd/2018/05/21/analysis-and-mitigation-of-speculative-store-bypass-cve-2018-3639/

  2. https://blogs.technet.microsoft.com/srd/2018/03/15/mitigating-speculative-execution-side-channel-hardware-vulnerabilities/

  3. https://bugs.chromium.org/p/project-zero/issues/detail?id=1528

  4. https://access.redhat.com/security/vulnerabilities/ssbd

  5. https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00115.html