Forskere fra Massachusetts Institute of Technology har identificeret angrebsteknikken TONTOU (Time-of-Neutralization to Time-of-Use), som tilbyder en ny måde at udnytte mikroarkitektur sårbarheder af typen Spectre v2. Sårbarheden gør det muligt at bestemme indholdet af kernens hukommelse, mens exploiten kører i brugerrum. Koden til blokering af udnyttelse af sårbarheden blev inkluderet i Linux-kernen den 5. august og er indgået i versionerne 7.1.7, 6.18.43, 6.12.102, 6.6.149, 6.1.181, 5.15.214 og 5.10.263.
Forskere har demonstreret muligheden for, at en lokal ikke-privilegeret bruger kan bestemme hash-værdien af root-brugerens adgangskode, der gemmes i filen /etc/shadow og indlæses i hukommelsen under autentificeringen i systemet. Forskere formåede at opnå datalækage fra kernens hukommelse med en hastighed på 5,47 byte per sekund og en nøjagtighed på 91,97%. Af 10 testkørsler, der i gennemsnit varede i 18 minutter, lykkedes det i halvdelen af tilfældene at bestemme tilstedeværelsen af filen /etc/shadow i hukommelsen og udtrække dens indhold.
Exploiten er demonstreret på systemer med AMD-processorer og kan anvendes med AMD CPU'er fra Zen 1-4-familien. På Intel-systemer er angrebet også muligt, men udnyttelsen er mere kompleks. For at beskytte mod stack-overflow af returadresser og blokere sårbarheden SRSO (Speculative Return Stack Overflow) anvender AMD-processorer en beskyttelsesmekanisme ved navn Safe-RET, som rydder branch-predictor-bufferet efter hvert brug og indsnævrer angrebsvinduet til 2 instruktioner, der udføres i løbet af flere titusindedele af et sekund.
For circumventing this protection and extending the attack window, a CPU throttling technique has been implemented, allowing the attacker to execute an interrupt substitution at the right moment to redirect the execution flow in the kernel and use the interrupt handler to corrupt the entries in the branch prediction buffer. To exploit the SRSO vulnerability, the attacker can create conditions under which the branch prediction block speculatively executes a large number of incorrectly predicted CALL invocations, sufficient to overflow the return address stack and overwrite correctly predicted return points located at the beginning of the stack. As a result, the initial stack elements can be overwritten with values chosen by the attacker, which will later lead to the use of these replaced values during the speculative execution of the RET instruction in the context of another process.
The processor will determine that the branch prediction failed and will revert the operation to its initial state, but the data processed during speculative execution will remain in the cache and microarchitectural buffers. If the incorrectly executed block accesses memory, its speculative execution will result in data being cached from the memory read. One of the methods for extracting information from the cache may involve analyzing changes in access time to cached and uncached data.
Kilde: opennet.ru
