F*CKWIT, Spectre, Meltdown – หลากหลายชื่อช่องโหว่ใน CPU
ในช่วงสัปดาห์ที่ผ่านมาต่างมีคนพูดถึงเรื่องช่องโหว่ที่หลากหลายมากไม่ว่าจะเป็น F*CKWIT(Forcefully Unmap Complete Kernel With Interrupt Trampolines) Intel CPU flaw (หรือที่รู้จักกันในนาม KPTI หรือ KAISER) และ Spectre, Meltdown เรามาดูกันว่ามันคืออะไรยังไง
กลุ่ม security ระดับโลกอย่าง Project Zero ของ Google ได้เปิดเผยช่องโหว่รุนแรงใน CPU ซึ่งทำให้ user สามารถเข้าถึง memory ของ CPU ซึ่งเจอทั้งใน Intel, AMD และ ARM CPU processors ซึ่งตัวช่องโหว่จะแบ่งเป็น 2 ช่องโหว่คือ Meltdown และ Spectre โดยช่องโหว่ทั้งคู่จะทำให้ Hacker สามารถเข้าถึง memory ที่กำลังถูกใช้งานโดย CPU อยู่ได้ ซึ่งโดยปกติแล้ว program จะไม่มีสิทธิ์ในการเข้าไปอ่าน data ของโปรแกรมอื่น นั่นหมายความว่า program ที่เป็น malware แล้วสามารถโจมตี Meltdown หรือ Spectre ได้ ก็จะสามารถเข้าถึงข้อมูลสำคัญของโปรแกรมอื่นๆที่กำลังทำงานอยู่ได้ นั่นหมายความว่าหากมี program จำพวก Password Manager กำลังทำงานอยู่ ตัว Application ที่เป็น malware ที่โจมตี Meltdown หรือ Spectre ได้ ก็จะอาจจะสามารถเข้าถึง password ที่ถูกเก็บใน Password Manager นั่นเอง
ตัว Meltdown และ Spectre นั้นกระทบทั้งใน Computer, มือถือ รวมถึงระบบที่อยู่บน Cloud อีกด้วย
- Meltdown
Meltdown จะเป็นช่องโหว่ที่ตัวแยกระหว่าง User Application กับ OS ซึ่งการโจมตีช่องโหว่นี้จะทำให้ Program เข้าถึงส่วน memory ของโปรแกรมอื่นๆรวมถึง OS ได้
- Spectre
Spectre เป็นช่องโหว่ที่ตัวแยกระหว่าง application ที่แตกต่างกัน ซึ่งทำให้ Attacker ไปเอาข้อมูลจาก error-free program ตัว Spectre นั้นยากกว่าทาง Meltdown แต่ก็ยากที่จะแก้ไขมากกว่าเช่นกัน
ความแตกต่างระหว่าง Meltdown และ Spectre
User ได้รับผลกระทบขนาดไหน
เอาจริงๆมันแทบไม่ได้รับผลกระทบเลยครับ เนื่องด้วยถ้า user ไม่เอา application อะไรมารันก็จะไม่ได้รับผลกระทบอะไรครับ (ซึ่งจริงๆนั่นคือต่อให้เป็น malware ประเภทอื่น ถ้าไม่เอามารันก็ไม่ได้รับผลกระทบอะไรเช่นกันครับ มันเป็นปกติของ malicious application น่ะครับ) ที่ได้รับผลกระทบหลักๆน่าจะเป็น Cloud Provider ต่างๆที่ user เอา application อะไรมารันก็ได้มากกว่า ซึ่งเมื่อถึงจุดที่มันสามารถเข้าถึง memory ของ CPU ซึ่งใช้ร่วมกันได้ มันก็จะกลายเป็นว่าเราสามารถเข้าถึงข้อมูลของ user คนอื่นที่ใช้ Cloud ร่วมกันได้นั่นเอง
Patch ที่ไหนออกแล้วบ้าง
- Microsoft ออก patch แบบ out of band (แบบเร่งด่วนไม่รอ Patch Tuesday ประจำเดือน) ออกมาแก้ไขช่องโหว่นี้ใน Windows 10 แล้ว และส่วนตัวอื่นๆจะตามในวันที่ 9 มกราคม 2018 ครับ
- Linux ออก patch แล้วเช่นกัน
- Android version ล่าสุดได้รับการป้องกันจากช่องโหว่นี้แล้ว
- MacOS fix ไปแล้วใน MacOS 10.13.2
- เหล่า Cloud Provider เจ้าใหญ่อย่าง AWS, Google Cloud, Microsoft Azure นั้นมีการ patch ไปแล้ว
วิธีการตรวจสอบเบื้องต้นว่า CPU ของเรามีช่องโหว่หรือไม่
- เปิด powershell ขึ้นมา
- ติดตั้ง module เพิ่มเติม
1 |
Install-Module SpeculationControl |
1 |
Get-SpeculationControlSettings |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Speculation control settings for CVE-2017-5715 [branch target injection] Hardware support for branch target injection mitigation is present: True Windows OS support for branch target injection mitigation is present: True Windows OS support for branch target injection mitigation is enabled: True Speculation control settings for CVE-2017-5754 [rogue data cache load] Hardware requires kernel VA shadowing: True Windows OS support for kernel VA shadow is present: True Windows OS support for kernel VA shadow is enabled: True Windows OS support for PCID optimization is enabled: True |
1 2 3 4 5 6 7 8 9 10 11 |
Import-Module SpeculationControl $scriptstring = Get-Content -Path (Get-Module SpeculationControl).Path | % { if (-not ($_ -match “^\# “)) { $_ }} | Out-String $scriptstring += ' function Write-Host {} ' $scriptstring += 'Get-SpeculationControlSettings' $script=[scriptblock]::create($scriptstring) Invoke-Command -ComputerName localhost, system2, system3 -ScriptBlock $script |
Affected Vendor
https://www.welivesecurity.com/2018/01/05/meltdown-spectre-cpu-vulnerabilities/#vendors
PoC Code
- https://github.com/turbo/KPTI-PoC-Collection
- SpecuCheck
- https://gist.github.com/Badel2/ba8826e6607295e6f26c5ed098d98d27
- https://bugs.chromium.org/p/project-zero/issues/detail?id=1272
- https://github.com/IAIK/meltdown
Source::
- https://spectreattack.com/
- https://danielmiessler.com/blog/simple-explanation-difference-meltdown-spectre/
- https://security.googleblog.com/2018/01/todays-cpu-vulnerability-what-you-need.html
- https://security.googleblog.com/2018/01/todays-cpu-vulnerability-what-you-need.html
- https://nakedsecurity.sophos.com/2018/01/03/fckwit-aka-kaiser-aka-kpti-intel-cpu-flaw-needs-low-level-os-patches/
- https://thehackernews.com/2018/01/meltdown-spectre-vulnerability.html
- https://blog.mozilla.org/security/2018/01/03/mitigations-landing-new-class-timing-attack/
- https://www.cyberciti.biz/faq/patch-spectre-vulnerability-cve-2017-5753-cve-2017-5715-linux/
- https://www.bleepingcomputer.com/news/security/list-of-meltdown-and-spectre-vulnerability-advisories-patches-and-updates/
- https://www.bleepingcomputer.com/news/security/list-of-meltdown-and-spectre-vulnerability-advisories-patches-and-updates/
- https://support.microsoft.com/en-hk/help/4073119/protect-against-speculative-execution-side-channel-vulnerabilities-in
- https://docs.google.com/spreadsheets/d/184wcDt9I9TUNFFbsAVLpzAtckQxYiuirADzf3cL42FQ/htmlview?usp=sharing&sle=true
- https://blogs.technet.microsoft.com/ralphkyttle/2018/01/05/verifying-spectre-meltdown-protections-remotely/?lipi=urn%3Ali%3Apage%3Ad_flagship3_feed%3BVhs9x8%2B2R5%2BfRHHfziWxdw%3D%3D