PortSmash Hyper-Threading Vuln Steals Decrypt Keys

PortSmash Hyper-Threading Vuln Steals Decrypt Keys

A new side-channel vulnerability has been found called PortSmash that uses a timing attack that to steal info from other processes running in the same CPU core with SMT/hyper-threading enabled.

Utilizing this attack, researchers were able to steal the private decryption key from an OpenSSL thread running in the same core as their exploit.crypto

For those that dont know, SMT/Hyper-threading is when one physical CPU core is split into two virtual logical cores that can be used two run two separate process threads at once.

This method can increase performance as the two threads will utilize idle CPU resources more efficiently to execute instructions faster.

A side channel timing attack is when an attacker analyzes how fast a thread executes particular instructions and utilizes that info to work backwards to discover what data was used as input.

The PortSmash vulnerability was discovered by researchers Billy Bob Brumley, Sohaib ul Hassan, Cesar Pereida Garcia, and Nicola Tuveri from the Tampere University of Technology in Finland as well as Alejandro Cabrera Aldaya from the Universidad Tecnologica de la Habana CUJAE in Cuba.

An advisory was made to the OSS-Sec mailing list and their research has been submitted as a paper titled “Port Contention for Fun and Profit” as a IACR eprint, which is currently awaiting moderation before it’s released.

In an email with the researchers, Nicola Tuveri explained to us that port contention was used to measure how long it took OpenSSL to perform an operation.

Using these measurements, the researchers were able to work backwards to recover a private key.

“Shortly and simplifying, with SMT and two threads per core, a process running on one thread will have its own instructions and data, but will share some hardware resources with a process running on the colocated thread.

Instructions will be decoded independently in simpler micro-operations and pipe-lined in the CPU to the corresponding Execution Units. (Execution Units are the actual silicon areas that are specialized to handle specific operations: i.e, there are a few EU dedicated to integer additions/subtraction, separate ones for integer multiplication, other for floating point arithmetic, etc.)

Every core has a complete set of EUs to support the whole instruction set, and threads on the same core share access to the EUs.

EUs are grouped together in bundles each accessible through a port: microops from the two threads are issued to the available ports, and another micro-component, the core scheduler, optimizes for fairness and performance when the same microop can be issued to different equivalent EUs behind different ports.

These ports are the object of the discussed port contention. Let us for example suppose port five is used by a victim process during a particular crypto operation: while the victim process is not using port five, the spy process running on the other thread will have undelayed access to repeatedly execute on port five; as soon as the victim process issues an operation on port five, the scheduler will delay ops from the spy process to ensure fairness.

The spy process can therefore measure the delay in the execution of its operations for port five, and determine when the victim process is using the same port.

This is the signal that can then be processed to ultimately recover a private key.” – stated Nicola Tuveri.

While the researchers have only tested this vulnerability against Intel Skylake and Kaby Lake processors, they also expect it to work on AMD Ryzen processors.

“We verified it on Intel Skylake and Kaby Lake, but just because we did not have access to different machines with SMT,” Nicola Tuveri told CBNN. “We expect it to work also on AMD Ryzen, but left this to future work.”

The researchers shared a proof-of-concept exploit that only targets OpenSSL. The team chose to target OpenSSL because they are familiar with the code base and because it is so widely used, but that the “PortSmash technique is not tied to a particular software.”

Therefore, it is only a matter of time until diligent researchers and attackers port the PoC to steal info from other apps.

Fixes for this attack have already been added to OpenSSL 1.1.1 and for those who need an older version, patches are available for versions >= 1.1.0i.

Protecting yourself from the PortSmash vulnerability

The only way to mitigate this attack is to disable SMT/Hyper-threading on a computer, which OpenBSD has already done by default since this summer when another timing attack was released called TLBleed.

“We recommend disabling SMT/Hyper-threading as a countermeasure. OpenBSD, for instance, already disables it by default since this summer.”


No Comments

  1. 5426 69526 92236 33533 13810 51574 80886 57706 17718 60640 54525 61018 31677 40323 19238 25262 68404 69795 52341 57977 68931 19636 48513 94855 11608 60964 75975 91958 97367 73671 69698 52452 81989 36482 85744 2317 44549 28952 40307 72571 42248 83329 80278 44518 11126 70154 46204 90579 48848 21795 46909 58503 80270 63332 98657 59476 40905 4790 65955 49167 58572 49945 1910 21080 46832 69209 38365 63272 94497 99214 97285 77085 35438 94856 96680 25720 26271 32617 61665 40660 42453 69527 43917 89272 72771 65519 47316 93588 23356 51415 58657 5823 23422 60315 84537 38413 44973 14603 95537 59666 23127*-%D1%80%E2%80%98%D1%80%E2%80%A2%D1%80*%D1%80%D1%99%D1%80%D0%88%D1%80%D1%9E-%D1%80%C2%A4%D1%80%C2%98%D1%80%E2%80%BA%D1%80%C2%AC%D1%80%D1%9A-2020-%D1%80%D0%8E%D1%80%D1%9A%D1%80%D1%9B%D1%80%D1%9E%D1%80*%D1%80%E2%80%A2%D1%80%D1%9E%D1%80%C2%AC-%D1%80%D1%9B%D1%80%D1%9C%D1%80%E2%80%BA%D1%80%D1%92%D1%80%E2%84%A2%D1%80%D1%9C-%D1%81%D1%93%D1%80%D1%94%D1%81%D0%82%D1%80%C2%B0%D1%81%E2%80%94%D1%80%D0%85%D1%81%D0%83%D1%81%D0%8A%D1%80%D1%94%D1%80%D1%91%D1%80%E2%84%96-%D1%81%E2%80%9E%D1%81%E2%80%93%D1%80%C2%BB%D1%81%D0%8A%D1%80%D1%98&p=66930#post66930 99554 38691 89180 29684 8184 40770 2264 78881 92812 46799 46926 11211 34112 93457 58172 98857 72532 14122 41966 54836 29530 57509 16665 13199

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.