Jump to content

Spectre (security vulnerability): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Weakened "The authors show how the attack can be carried out" to "The authors describe how they succeeded in carrying out this attack"
mNo edit summary
Line 10: Line 10:


== Attacks ==
== Attacks ==
The high-level observation made by the Spectre paper <ref name=SpectrePaper /> is that '''speculative execution may leave observable side effects that may reveal private data''' (1), for the first time identifying a class of attacks that exploit speculative execution (2). Such attacks may be classified by the type of branches whose prediction initiates the speculative execution:
The high-level observation made in the Spectre paper <ref name=SpectrePaper /> is that '''speculative execution may leave observable side effects that may reveal private data''' (1), for the first time identifying a class of attacks that exploit speculative execution (2). Such attacks may be classified by the type of branches whose prediction initiates the speculative execution:
* '''Conditional branch''' prediction (3) can potentially be exploited if the program under attack performs a '''bounds check''' (4) on attacker input that is subsequently used as the index for an array dereference. A misprediction may cause this dereference to read private data. If the resulting value is then used as the index for a second array dereference, the private data may leak into the state of data cache (5). The authors describe how they succeeded in carrying out this attack using JavaScript code running in a web browser to read private memory from the browser process (6).
* '''Conditional branch''' prediction (3) can potentially be exploited if the program under attack performs a '''bounds check''' (4) on attacker input that is subsequently used as the index for an array dereference. A misprediction may cause this dereference to read private data. If the resulting value is then used as the index for a second array dereference, the private data may leak into the state of data cache (5). The authors describe how they succeeded in carrying out this attack using JavaScript code running in a web browser to read private memory from the browser process (6).
* Mistraining the branch predictor can potentially cause an '''indirect branch''' to speculatively jump to an arbitrary attacker-chosen address (7). The authors explain how they succeeded in making a program under attack jump to instructions that caused private data to leak into the state of the data cache (8).
* Mistraining the branch predictor can potentially cause an '''indirect branch''' to speculatively jump to an arbitrary attacker-chosen address (7). The authors explain how they succeeded in making a program under attack jump to instructions that caused private data to leak into the state of the data cache (8).

Revision as of 23:45, 14 January 2018

A logo created for the vulnerability, featuring a ghost with a branch

Spectre is a vulnerability that affects modern microprocessors with speculative execution.[1][2][3] Speculative execution on most processors may leave observable side effects that may reveal private data to attackers. For example, if the pattern of memory accesses performed by code speculatively executed after an incorrect branch prediction depends on private data, the resulting state of the data cache constitutes a side channel through which an attacker may be able to extract information about the private data using a timing attack.[4][5][6]

Two Common Vulnerabilities and Exposures IDs related to Spectre, CVE-2017-5753 (bounds check bypass) and CVE-2017-5715 (branch target injection), have been issued.[7] JIT engines used for JavaScript were found vulnerable. A website can read data stored in the browser for another website, or the browser's memory itself.[8]

Several procedures to help protect home computers and related devices from the Spectre (and Meltdown) security vulnerabilities have been published.[9][10][11][12] Spectre patches have been reported to significantly slow down performance, especially on older computers; on the newer 8th generation Core platforms, benchmark performance drops of 2–14 percent have been measured.[13] Meltdown patches may also produce performance loss.[5][14][15]

Attacks

The high-level observation made in the Spectre paper [1] is that speculative execution may leave observable side effects that may reveal private data (1), for the first time identifying a class of attacks that exploit speculative execution (2). Such attacks may be classified by the type of branches whose prediction initiates the speculative execution:

  • Conditional branch prediction (3) can potentially be exploited if the program under attack performs a bounds check (4) on attacker input that is subsequently used as the index for an array dereference. A misprediction may cause this dereference to read private data. If the resulting value is then used as the index for a second array dereference, the private data may leak into the state of data cache (5). The authors describe how they succeeded in carrying out this attack using JavaScript code running in a web browser to read private memory from the browser process (6).
  • Mistraining the branch predictor can potentially cause an indirect branch to speculatively jump to an arbitrary attacker-chosen address (7). The authors explain how they succeeded in making a program under attack jump to instructions that caused private data to leak into the state of the data cache (8).
  • The authors point out that attacks might also be possible that exploit misprediction of return (9) instructions or return from interrupt (10) instructions.

The authors further point out that besides timing variations due to the speculatively executed code's use of the data cache, other potential side channels include e.g. timing variations due to contention on arithmetic units or contention on the register file.

The term "Spectre attack" has been used in the Spectre paper and in other sources to refer at different times to various of these classes (1-10) of attacks.

History

In 2005, Daniel Bernstein from the university of Illinois reported an extraction of an OpenSSL AES key via a cache timing attack. 2013 Yuriv Yarom and Katrina Falkner from the University of Adelaide showed how measuring the access time to data lets a spy application guess if the information was read from the cache, or not. If it was read from the cache the access time was very short, and the data read could contain a the private key of encryption algorithms. Via this way GnuPG, AES and others were shown to be broken.[16][17] Later on multiple persons wondered if this could be extended to retrieve other information. Early 2017, Anders Fogh gave a presentation at the Ruhruniversität Bochum about automatically finding covert channels, especially on processors with a pipeline used by more than one processor core. [18].

Spectre was discovered independently by Jann Horn from Google's Project Zero and Paul Kocher in collaboration with Daniel Genkin, Mike Hamburg, Moritz Lipp and Yuval Yarom.[when?] Microsoft Vulnerability Research extended it to browsers' JavaScript JIT engines.[4][19] It was made public in conjunction with another vulnerability, Meltdown, on January 3, 2018, after the affected hardware vendors had already been made aware of the issue on June 1, 2017.[20]

The vulnerability was called "Spectre" because it "is based on the root cause, speculative execution. As it is not easy to fix, it will haunt us for quite some time."[21]

Impact

As of 2018, almost every computer system is affected by Spectre, including desktops, laptops, and mobile devices. Specifically, Spectre has been shown to work on Intel, AMD, ARM-based, and IBM processors.[22][23][24] Intel responded to the reported security vulnerabilities with an official statement.[25] AMD originally stated that vulnerability to one of the two Spectre variants had not been demonstrated on AMD processors, claiming it posed "near zero risk of exploitation" due to differences in AMD architecture.[26] However, AMD later stated that their processors were affected by both variants of Spectre.[27][28] Later reports also noted AMD problems with the security vulnerabilities.[29]

Researchers have indicated that the Spectre vulnerability can possibly affect some Intel, AMD, and ARM processors.[30][31][32][33] Specifically, processors with speculative execution are affected with these vulnerabilities.[34]

ARM has reported that the majority of their processors are not vulnerable, and published a list of the specific processors that are affected by the Spectre vulnerability: Cortex-R7, Cortex-R8, Cortex-A8, Cortex-A9, Cortex-A15, Cortex-A17, Cortex-A57, Cortex-A72, Cortex-A73 and ARM Cortex-A75 cores.[35]

A large portion of the current mid-range Android handsets use the Cortex-A53 or Cortex-A55 in an octa-core arrangement and are not affected by either the Meltdown or Spectre vulnerability as they do not perform out-of-order execution.[citation needed] This includes devices with the Qualcomm Snapdragon 630, Snapdragon 626, Snapdragon 625, and all Snapdragon 4xx processors based on A53 or A55 cores.[36] Also, all Raspberry Pi computers are not vulnerable to either Meltdown or Spectre.[37]

At present, Spectre has only been shown to work between user level programs, but it seems likely the attack can be developed further. While more difficult to utilize properly than Meltdown, Spectre may be much more challenging to defend against due to its generality. The original white paper even speculates that significant changes in microprocessor architecture might be needed in order to fully dispose of the problem.

Furthermore, Spectre has the potential of having a greater impact on cloud providers than Meltdown. Whereas Meltdown allows unauthorized applications to read from privileged memory to obtain sensitive data from processes running on the same cloud server, Spectre can allow malicious programs to induce a hypervisor to transmit the data to a guest system running on top of it.[38]

Mitigation

Since Spectre represents a whole class of attacks, there most likely cannot be a single patch for it.[3] While work is already being done to address special cases of the vulnerability, the original website devoted to Spectre and Meltdown states: "As [Spectre] is not easy to fix, it will haunt us for a long time."[4]

Nonetheless, several procedures to help protect home computers and related devices from the "Meltdown" and "Spectre" security vulnerabilities have been published.[9][10][11][12] Spectre patches have been reported to significantly slow down performance, especially on older computers; on the newer 8th generation Core platforms, benchmark performance drops of 2–14 percent have been measured.[13]

Exploitation through JavaScript embedded in websites is possible.[1] Chrome 64 will include mitigations against the attack by default, and Chrome 63 users can manually mitigate the attack by enabling the Site Isolation feature (chrome://flags#enable-site-per-process).[39] As of Firefox 57.0.4, Mozilla is reducing the resolution of JavaScript timers to help prevent timing attacks, with additional work on time-fuzzing techniques planned for future releases.[19][40] Alternately, browser-based exploitation can be prevented by disabling JavaScript (e.g. NoScript).

On January 4, 2018, Google detailed a new technique on their security blog called "Retpoline" (return trampoline)[41] which can overcome the Spectre vulnerability with a negligible amount of processor overhead. It involves compiler level steering of indirect branches towards a different target that does not result in a vulnerable speculative out-of-order execution taking place.[42][43] While it was developed for the x86 instruction set, the Google engineers believe the technique is transferable to other processors as well.[44]

It has also been suggested[45] that the cost of mitigation can be alleviated by processors which feature selective translation lookaside buffer (TLB) flushing, a feature which is called process-context identifier (PCID) under Intel 64 architecture, and under Alpha, an address space number (ASN). This is because selective flushing enables the TLB behavior crucial to the exploit to be isolated across processes, without constantly flushing the entire TLB – the primary reason for the cost of mitigation.[citation needed]

Summary of mitigations on Microsoft Windows[46]
Vulnerability CVE Exploit Name Public Vulnerability Name Windows Changes Firmware Changes
Spectre 2017-5753 Variant 1 Bounds Check Bypass Recompiling with a new compiler
Hardened Browser to prevent exploit from JavaScript
No
Spectre 2017-5715 Variant 2 Branch Target Injection New CPU instructions eliminating branch speculation Yes
(Meltdown) 2017-5754 Variant 3 Rogue Data Cache Load Isolate kernel and user mode page tables No


References

  1. ^ a b c Kocher, Paul; Genkin, Daniel; Gruss, Daniel; Haas, Werner; Hamburg, Mike; Lipp, Moritz; Mangard, Stefan; Prescher, Thomas; Schwarz, Michael; Yarom, Yuval (2018). "Spectre Attacks: Exploiting Speculative Execution" (PDF). Archived from the original (PDF) on January 3, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  2. ^ Greenberg, Andy (January 3, 2018). "A Critical Intel Flaw Breaks Basic Security for Most Computers". Wired. Archived from the original on January 3, 2018. Retrieved January 3, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  3. ^ a b Bright, Peter (January 5, 2018). "Meltdown and Spectre: Here's what Intel, Apple, Microsoft, others are doing about it". Ars Technica. Retrieved January 6, 2018.
  4. ^ a b c Staff (2018). "Meltdown and Spectre". Graz University of Technology. Archived from the original on January 3, 2018. Retrieved January 3, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  5. ^ a b Metz, Cade; Perlroth, Nicole (January 3, 2018). "Researchers Discover Two Major Flaws in the World's Computers". The New York Times. ISSN 0362-4331. Archived from the original on January 3, 2018. Retrieved January 3, 2018. {{cite news}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  6. ^ Warren, Tom (January 3, 2018). "Intel's processors have a security bug and the fix could slow down PCs". The Verge. Archived from the original on January 3, 2018. Retrieved January 3, 2018. {{cite news}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  7. ^ "Understanding the performance impact of Spectre and Meltdown mitigations on Windows Systems". Microsoft. January 9, 2018.
  8. ^ https://www.theregister.co.uk/2018/01/04/intel_amd_arm_cpu_vulnerability/ Meltdown, Spectre: The password theft bugs at the heart of Intel CPUs, the Register, 2018-01-04.
  9. ^ a b Metz, Cade; Chen, Brian X. (January 4, 2018). "What You Need to Do Because of Flaws in Computer Chips". The New York Times. Retrieved January 5, 2018.
  10. ^ a b Pressman, Aaron (January 5, 2018). "Why Your Web Browser May Be Most Vulnerable to Spectre and What to Do About It". Fortune (magazine). Retrieved January 5, 2018.
  11. ^ a b Chacos, Brad (January 4, 2018). "How to protect your PC from the major Meltdown and Spectre CPU flaws". PC World. Archived from the original on January 4, 2018. Retrieved January 4, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  12. ^ a b Elliot, Matt (January 4, 2018). "Security – How to protect your PC against the Intel chip flaw – Here are the steps to take to keep your Windows laptop or PC safe from Meltdown and Spectre". CNET. Archived from the original on January 4, 2018. Retrieved January 4, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  13. ^ a b Hachman, Mark (January 9, 2018). "Microsoft tests show Spectre patches drag down performance on older PCs". PC World. Retrieved January 9, 2018.
  14. ^ "Computer chip scare: What you need to know". BBC News. January 4, 2018. Retrieved January 4, 2018.
  15. ^ "Intel says processor bug isn't unique to its chips and performance issues are 'workload-dependent'". The Verge. Retrieved January 4, 2018.
  16. ^ Cache-timing attacks on AES, Daniel J. Bernstein, 2005-04-14.
  17. ^ FLUSH+RELOAD: A High Resolution, Low Noise, L3 Cache Side-Channel Attack, Yuval Yarom and Katrina Falkner, The University of Adelaide, 23rd USENIX Symposium, 2014-08-22 - 24, San Diego.
  18. ^ Anders Fogh: "Covert shotgun: Automatically finding covert channels in SMT", Ruhruniversität Bochum, HackPra channel from the Chair of Network and Data Security, 2017-01-12. Fogh describing a Side Channel using fashioned listening to a safe while turning its wheel
  19. ^ a b "Speculative execution side-channel attack ("Spectre")". Mozilla.
  20. ^ Gibbs, Samuel (January 4, 2018). "Meltdown and Spectre: 'worst ever' CPU bugs affect virtually all computers". The Guardian. Archived from the original on January 6, 2018. Retrieved January 6, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  21. ^ "Meltdown and Spectre". spectreattack.com.
  22. ^ Staff (2018). "Meltdown and Spectre-faq-systems-spectre". Graz University of Technology. Archived from the original on January 3, 2018. Retrieved January 4, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  23. ^ Busvine, Douglas; Nellis, Stephen (January 3, 2018). "Security flaws put virtually all phones, computers at risk". Reuters. Thomson-Reuters. Archived from the original on January 3, 2018. Retrieved January 3, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  24. ^ "Potential Impact on Processors in the POWER family". 2018.
  25. ^ Staff (January 3, 2018). "Intel Responds To Security Research Findings". Intel. Archived from the original on January 3, 2018. Retrieved January 4, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  26. ^ "An Update on AMD Processor Security". Advanced Micro Devices. 2018. Archived from the original on January 4, 2018. Retrieved January 4, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  27. ^ "AMD: Yes, Spectre does affect our processors". CNET. Retrieved January 12, 2018.
  28. ^ "AMD Processor Security | AMD". www.amd.com. Retrieved January 12, 2018.
  29. ^ Vaughan-Nichols, Steven J. (January 12, 2018). "AMD processors: Not as safe as you might have thought - With all the hub-bub about Meltdown and Spectre, AMD CPUs are widely regarded as being perfectly safe. Well AMD chips may be safer, but they're not invulnerable". ZDNet. Retrieved January 12, 2018.
  30. ^ "Who's affected by computer chip security flaw".
  31. ^ "Kernel-memory-leaking Intel processor design flaw forces Linux, Windows redesign".
  32. ^ Staff (2018). "Meltdown and Spectre-faq-systems-spectre". Graz University of Technology. Retrieved January 4, 2018.
  33. ^ Busvine, Douglas; Nellis, Stephen (January 3, 2018). "Security flaws put virtually all phones, computers at risk". Reuters. Thomson-Reuters. Retrieved January 3, 2018.
  34. ^ "Today's CPU vulnerability: what you need to know".
  35. ^ "Arm Processor Security Update". ARM Developer. ARM Ltd. January 3, 2018. Retrieved January 5, 2018.
  36. ^ "'Spectre' and 'Meltdown': New CPU vulnerabilities affect most smartphones and computers". January 4, 2018.
  37. ^ "Why Raspberry Pi isn't vulnerable to Spectre or Meltdown - Raspberry Pi". January 5, 2018.
  38. ^ Fox-Brewster, Thomas (January 3, 2018). "Massive Intel Vulnerabilities Just Landed -- And Every PC User On The Planet May Need To Update". Forbes. Forbes Media LLC. Archived from the original on January 3, 2018. Retrieved January 3, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  39. ^ "Google's Mitigations Against CPU Speculative Execution Attack Methods". support.google.com. Archived from the original on January 3, 2018. Retrieved January 4, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  40. ^ "Mitigations landing for new class of timing attack". Mozilla Security Blog. Archived from the original on January 4, 2018. Retrieved January 4, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  41. ^ "Intel Analysis of Speculative Execution Side Channels" (PDF). White Paper (336983-001 Revision 1.0). Intel. January 2018: 5. Retrieved January 11, 2018. second technique introduces the concept of a "return trampoline", also known as "retpoline" {{cite journal}}: Cite journal requires |journal= (help)
  42. ^ "More details about mitigations for the CPU Speculative Execution issue". Archived from the original on January 5, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  43. ^ "Google Says CPU Patches Cause 'Negligible Impact On Performance' With New 'Retpoline' Technique". tech.slashdot.org.
  44. ^ Paul Turner. "Retpoline: a software construct for preventing branch-target-injection – Google Help". support.google.com. Archived from the original on January 5, 2018. {{cite web}}: Unknown parameter |dead-url= ignored (|url-status= suggested) (help)
  45. ^ "How Will the Meltdown and Spectre Flaws Affect My PC?". How-To Geek.
  46. ^ "Understanding the performance impact of Spectre and Meltdown mitigations on Windows Systems". Microsoft. January 9, 2018.

Further reading