SlideShare a Scribd company logo
1 of 59
Time is not on your side:

Exploiting Browser-Based Timing Attacks
by Tom Van Goethem
Time is not on your side: Exploiting Browser-Based Timing Attacks
About me
• Tom Van Goethem!
• PhD Student at University of Leuven, Belgium!
• Research on security & privacy on the web,

current focus: side-channel attacks in the browser!
• Hacker/Security Researcher/CTFer (HacknamStyle)!
• Blog: https://vagosec.org!
• : @tomvangoethem
2
Time is not on your side: Exploiting Browser-Based Timing Attacks
Timing Attacks
• Type of side-channel attack!
• Observe information from the environment to infer
secret/private information!
• Known for decades, mainly in cryptography!
• Retrieve cryptographic keys!
• Exploit secure connections (e.g. Lucky13 attack)
3
Time is not on your side: Exploiting Browser-Based Timing Attacks
Timing Attack Concept
1. Perform action

2. Measure time from start to end

3. Compare/analyse timing measurement

4. Profit!
4
Time is not on your side: Exploiting Browser-Based Timing Attacks
Drunkenness Timing Attack
1. Perform action

→ Slap (drunk) person in face!
2. Measure time from start to end

→ start: slap in face, end: slap back!
3. Compare/analyse timing measurement

→ short: not drunk, long: DRUNK!!
4. Profit!
5
Drunkenness Timing Attack

The Experiment
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Drunkenness Timing Attack

The Experiment
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Drunkenness Timing Attack

The Experiment
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Drunkenness Timing Attack

The Experiment
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Drunkenness Timing Attack

The Experiment
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Probably not...
Drunkenness Timing Attack

The Experiment
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Probably not...
Drunkenness Timing Attack

The Experiment Part 2
Drunkenness Timing Attack

The Experiment (part 2)
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Drunkenness Timing Attack

The Experiment (part 2)
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Drunkenness Timing Attack

The Experiment (part 2)
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Drunkenness Timing Attack

The Experiment (part 2)
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
Drunkenness Timing Attack

The Experiment (part 2)
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
(08.578 > 03.297)
YES!
Drunkenness Timing Attack

The Experiment (part 2)
Test subject: 

! Mathias Bynens (@mathias)

Timer:
Is Mathias drunk?
(08.578 > 03.297)
YES!
Time is not on your side: Exploiting Browser-Based Timing Attacks
Timing Attacks
• Drunkenness Timing Attacks!
• Response time ~ drunkenness!
• Cryptographic key recovery!
• Execution time ~ bit is 1 or bit is 0!
• Lucky 13!
• TLS error message time ~ padding information/plaintext!
• Web-based Timing Attacks!
• ....
13
Time is not on your side: Exploiting Browser-Based Timing Attacks
Web-based Timing Attacks
• Known since 2000!!
• Pixel Perfect (by Paul Stone, 2013)!
• GPU rendering time ~ pixel color!
• JS comparison timing attack (by @sirdarckcat, 2013)!
• JS execution time ~ attacker input + secret data!
• Direct timing attack!
• Cross-site timing attack
14
(by Bortz & Boneh, 2007)
Time is not on your side: Exploiting Browser-Based Timing Attacks
Direct Timing Attack
15
username password
batman b4tm4n
Time is not on your side: Exploiting Browser-Based Timing Attacks
POST /login/!
!
username=batman

&password=aaa

Direct Timing Attack
15
username password
batman b4tm4n
Time is not on your side: Exploiting Browser-Based Timing Attacks
Direct Timing Attack
16
username password
batman b4tm4n
Time is not on your side: Exploiting Browser-Based Timing Attacks
POST /login/!
!
username=batman

&password=baa

Direct Timing Attack
16
username password
batman b4tm4n
Time is not on your side: Exploiting Browser-Based Timing Attacks
Direct Timing Attack
• Many limitations!
• Network irregularities!
• Concurrent users!
• ...!
• Many “solutions”!
• Get VM on same cloud machine (e.g. AWS)!
• Use very precise timing methods!
• Use statistical tests
17
Time is not on your side: Exploiting Browser-Based Timing Attacks
Cross-site Timing Attacks
• Request to the server is sent by victim!
• Cookies are attached to the request!
• Response is specific to the state of the user!
• example: logged in → large response 

not logged in → small response!
• Attacker measures response time with JS!
• Bypasses Same-Origin Policy
18
Time is not on your side: Exploiting Browser-Based Timing Attacks
Same-Origin Policy
• Main security principle of the web!!
• attacker.com can not read anything from
example.com!
• The length of the resources is also secret!
• With only length information, attacker can infer a lot of
private information (see demo later)
19
GET /batman/
GET /joker/
GET /joker/
Time is not on your side: Exploiting Browser-Based Timing Attacks
Classic Cross-site Timing Attacks
• Classic timing attacks have several limitations!
• Network irregularities!
• gzip compression!
• Round-trip for each measurement!
• Rate-limiting
23
Time is not on your side: Exploiting Browser-Based Timing Attacks
Browser-based Timing Attacks
• Timing attacks in browsers overcome these
limitations!
• Timing measurement starts after resource is downloaded!
• Measurements are more accurate!
• For some attacks: resource is only downloaded once!
• Obtain multiple measurements in short interval
24
GET /batman/
Time is not on your side: Exploiting Browser-Based Timing Attacks
Browser-based Timing Attacks
• Side-channels allow measuring time to process
resource!
• Parse as specific format (~ CPU processing time)!
• Retrieve from cache (~ disk read time)!
• Store in cache (~ disk write time)
26
The Clock is Still Ticking: Timing Attacks in the Modern Web
Video Parsing Attack
27
var video = document.createElement('video');
!
// suspend => download complete
video.addEventListener('suspend', function(){
startMeasurement();
});
!
// error => parsing complete
video.addEventListener('error', function(){
stopMeasurement();
});
!
video.src = 'http://example.org/resource';
The Clock is Still Ticking: Timing Attacks in the Modern Web
Cache Storing Attack
28
var resource = 'http://example.org/resource';
var foo = new Request('foo');
fetch(resource).then(function(resp) {
// Resource download complete
startMeasurement();
return cache.put(foo, resp.clone())
}).then(function() {
// Resource stored in cache
stopMeasurement();
});
●
● ●
●
●
●
●
●
●
● ● ● ● ● ● ● ●
0
2500
5000
7500
25 50 75 100
Difference in file size (kB)
Avg.timetoperformtimingattack(ms)
● Classic timing attack
Video parsing attack
Cache storing attack
Cache + video parsing
Demo
Time is not on your side: Exploiting Browser-Based Timing Attacks
Age-discovery Attack
1. Create Facebook posts, each targeted to users of a specific age!
2. Discover age-range of the user!
• Fetch corresponding resources!
• Obtain timing measurements!
• Determine age-range according to the value of timing
measurements!
3. Discover exact age of the user!
• Repeat (2) but for posts targeted to specific age
32
Time is not on your side: Exploiting Browser-Based Timing Attacks
Mitigation
• Client-side!
• Non-trivial!
• Reduce timer resolution: ms resolution sufficient!
• Timing side-channels exist by the browser design!
• Disable 3rd-party cookies? SameSite cookies?!
• Server-side!
• Cause is related to CSRF!
• Prevent illegitimate cross-origin requests
36
Time is not on your side: Exploiting Browser-Based Timing Attacks
“It seems like this is very similar to another report about cache-
based side channel attacks from "The spy in the sandbox," so
I'm marking this as a duplicate.”
“This isn't an issue Firefox can solve on its own; much of it is
inherent in the design of the features. After the paper is
published we can work with Chrome folks and other browser
vendors to see if there are any reasonable ways to address
this”
Mitigation!
(current status)
37
https://bugzilla.mozilla.org/show_bug.cgi?id=1211669
https://code.google.com/p/chromium/issues/detail?id=539390
Time is not on your side: Exploiting Browser-Based Timing Attacks
Conclusion
• Novel browser-based timing attacks!
• Timing measurement starts after resource is downloaded!
• Faster & more robust than classic timing attacks!
• Side-channels exist by design!
• Many major popular web applications are vulnerable!
• Mitigation is challenging
38
Time is not on your side: Exploiting Browser-Based Timing Attacks
Questions?
39
: @tomvangoethem
Time is not on your side: Exploiting Browser-Based Timing Attacks
Questions?
39
: @tomvangoethem
Time is not on your side: Exploiting Browser-Based Timing Attacks
Mitigation!
(current status)
“We ended up discussing this at length with the
Facebook Security Team, and at the time we do not
plan to make any changes to our site.”!
!
[geographic location of a user]: “This information is
not expected to be private, so we don't consider that
aspect a vulnerability.”

[connection status of users]: “If it is possible to exploit
in the manner described, we would like to address
this.”

“The relationship of a member to a company is not
considered private information on our site, so we don't
consider that aspect a vulnerability.”
40
Time is not on your side: Exploiting Browser-Based Timing Attacks
AppCache attack
• Specify which resources need to be cached!
• This include cross-origin resources!
• After caching, measure time required to load
resources!
• Time between setting src and onerror on images
• Often too fast for accurate measurement!
• → load resources multiple times!
• Resources only need to be downloaded once
41
Time is not on your side: Exploiting Browser-Based Timing Attacks
Cache storing attack
• Can be done using ServiceWorkers!
• Lifetime independent of the web page that created them!
• Works even when user is offline!
• Resources only need to be downloaded once
42
●
●
●
●
● ● ● ● ● ● ●
● ● ●
●
●
● ● ●
0
2500
5000
7500
25 50 75 100
Difference in file size (kB)
Avg.timetoperformtimingattack(ms)
● Application Cache
Basic
Cache + video parsing
Script parsing
Service Workers
Video parsing

More Related Content

Viewers also liked

Viewers also liked (20)

Пакетный менеджер CrossPM: упрощаем сложные зависимости | Александр Ковалев
Пакетный менеджер CrossPM: упрощаем сложные зависимости | Александр КовалевПакетный менеджер CrossPM: упрощаем сложные зависимости | Александр Ковалев
Пакетный менеджер CrossPM: упрощаем сложные зависимости | Александр Ковалев
 
TeamPass - управление разграничением доступа к сервисным паролям в команде | ...
TeamPass - управление разграничением доступа к сервисным паролям в команде | ...TeamPass - управление разграничением доступа к сервисным паролям в команде | ...
TeamPass - управление разграничением доступа к сервисным паролям в команде | ...
 
Сообщество DevOpsHQ: идеология и инструменты | Александр Паздников
Сообщество DevOpsHQ: идеология и инструменты | Александр ПаздниковСообщество DevOpsHQ: идеология и инструменты | Александр Паздников
Сообщество DevOpsHQ: идеология и инструменты | Александр Паздников
 
Нейронечёткая классификация слабо формализуемых данных | Тимур Гильмуллин
Нейронечёткая классификация слабо формализуемых данных | Тимур ГильмуллинНейронечёткая классификация слабо формализуемых данных | Тимур Гильмуллин
Нейронечёткая классификация слабо формализуемых данных | Тимур Гильмуллин
 
Метод машинного обучения для распознавания сгенерированных доменных имен
Метод машинного обучения для распознавания сгенерированных доменных именМетод машинного обучения для распознавания сгенерированных доменных имен
Метод машинного обучения для распознавания сгенерированных доменных имен
 
Организация workflow в трекере TFS | Алексей Соловьев
Организация workflow в трекере TFS | Алексей СоловьевОрганизация workflow в трекере TFS | Алексей Соловьев
Организация workflow в трекере TFS | Алексей Соловьев
 
SupplyLab - публикация, доставка, развёртывание, лицензирование | Александр П...
SupplyLab - публикация, доставка, развёртывание, лицензирование | Александр П...SupplyLab - публикация, доставка, развёртывание, лицензирование | Александр П...
SupplyLab - публикация, доставка, развёртывание, лицензирование | Александр П...
 
Практические рекомендации по использованию системы TestRail | Дмитрий Рыльцов...
Практические рекомендации по использованию системы TestRail | Дмитрий Рыльцов...Практические рекомендации по использованию системы TestRail | Дмитрий Рыльцов...
Практические рекомендации по использованию системы TestRail | Дмитрий Рыльцов...
 
Модель системы Continuous Integration в компании Positive Technologies | Тиму...
Модель системы Continuous Integration в компании Positive Technologies | Тиму...Модель системы Continuous Integration в компании Positive Technologies | Тиму...
Модель системы Continuous Integration в компании Positive Technologies | Тиму...
 
Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...
Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...
Автоматизация нагрузочного тестирования в связке JMeter + TeamСity + Grafana ...
 
Доставка зловредов через облака
Доставка зловредов через облакаДоставка зловредов через облака
Доставка зловредов через облака
 
Система мониторинга Zabbix в процессах разработки и тестирования | Алексей Буров
Система мониторинга Zabbix в процессах разработки и тестирования | Алексей БуровСистема мониторинга Zabbix в процессах разработки и тестирования | Алексей Буров
Система мониторинга Zabbix в процессах разработки и тестирования | Алексей Буров
 
vSphereTools - инструмент для автоматизации работы с vSphere | Тимур Гильмуллин
vSphereTools - инструмент для автоматизации работы с vSphere | Тимур ГильмуллинvSphereTools - инструмент для автоматизации работы с vSphere | Тимур Гильмуллин
vSphereTools - инструмент для автоматизации работы с vSphere | Тимур Гильмуллин
 
Инструментарий для создания дистрибутивов продуктов | Владимир Селин
Инструментарий для создания дистрибутивов продуктов | Владимир СелинИнструментарий для создания дистрибутивов продуктов | Владимир Селин
Инструментарий для создания дистрибутивов продуктов | Владимир Селин
 
От простого к сложному: автоматизируем ручные тест-планы | Сергей Тимченко
От простого к сложному: автоматизируем ручные тест-планы | Сергей ТимченкоОт простого к сложному: автоматизируем ручные тест-планы | Сергей Тимченко
От простого к сложному: автоматизируем ручные тест-планы | Сергей Тимченко
 
Инструменты для проведения конкурентного анализа программных продуктов | Вла...
Инструменты для проведения конкурентного анализа программных продуктов |  Вла...Инструменты для проведения конкурентного анализа программных продуктов |  Вла...
Инструменты для проведения конкурентного анализа программных продуктов | Вла...
 
Интеграция TeamCity и сервера символов | Алексей Соловьев
Интеграция TeamCity и сервера символов | Алексей СоловьевИнтеграция TeamCity и сервера символов | Алексей Соловьев
Интеграция TeamCity и сервера символов | Алексей Соловьев
 
Общая концепция системы развёртывания серверного окружения на базе SaltStack ...
Общая концепция системы развёртывания серверного окружения на базе SaltStack ...Общая концепция системы развёртывания серверного окружения на базе SaltStack ...
Общая концепция системы развёртывания серверного окружения на базе SaltStack ...
 
Обход файрволов веб-приложений
Обход файрволов веб-приложенийОбход файрволов веб-приложений
Обход файрволов веб-приложений
 
Страх и ненависть в телеком-операторах
Страх и ненависть в телеком-операторахСтрах и ненависть в телеком-операторах
Страх и ненависть в телеком-операторах
 

Similar to Возможно, время не на твоей стороне. Реализация атаки по времени в браузере

US-13-Singh-Hot-Knives-Through-Butter-Evading-File-Based-Sandboxes-Slides
US-13-Singh-Hot-Knives-Through-Butter-Evading-File-Based-Sandboxes-SlidesUS-13-Singh-Hot-Knives-Through-Butter-Evading-File-Based-Sandboxes-Slides
US-13-Singh-Hot-Knives-Through-Butter-Evading-File-Based-Sandboxes-Slides
Abhishek Singh
 
Security Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn Việt
Security Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn ViệtSecurity Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn Việt
Security Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn Việt
Security Bootcamp
 
CSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on androidCSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on android
CanSecWest
 
HTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implicationsHTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implications
Priyanka Aash
 

Similar to Возможно, время не на твоей стороне. Реализация атаки по времени в браузере (20)

Getting ready for a Capture The Flag Hacking Competition
Getting ready for a Capture The Flag Hacking CompetitionGetting ready for a Capture The Flag Hacking Competition
Getting ready for a Capture The Flag Hacking Competition
 
US-13-Singh-Hot-Knives-Through-Butter-Evading-File-Based-Sandboxes-Slides
US-13-Singh-Hot-Knives-Through-Butter-Evading-File-Based-Sandboxes-SlidesUS-13-Singh-Hot-Knives-Through-Butter-Evading-File-Based-Sandboxes-Slides
US-13-Singh-Hot-Knives-Through-Butter-Evading-File-Based-Sandboxes-Slides
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
 
Security Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn Việt
Security Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn ViệtSecurity Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn Việt
Security Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn Việt
 
Program security
Program securityProgram security
Program security
 
Breaking Fraud & Bot Detection Solutions
Breaking Fraud & Bot Detection SolutionsBreaking Fraud & Bot Detection Solutions
Breaking Fraud & Bot Detection Solutions
 
Side-Channels on the Web: Attacks and Defenses
Side-Channels on the Web: Attacks and DefensesSide-Channels on the Web: Attacks and Defenses
Side-Channels on the Web: Attacks and Defenses
 
Security 101
Security 101Security 101
Security 101
 
Crypto Miners in the Cloud
Crypto Miners in the CloudCrypto Miners in the Cloud
Crypto Miners in the Cloud
 
Phinding Phish: An Evaluation of Anti-Phishing Toolbars, at NDSS 2007
Phinding Phish: An Evaluation of Anti-Phishing Toolbars, at NDSS 2007Phinding Phish: An Evaluation of Anti-Phishing Toolbars, at NDSS 2007
Phinding Phish: An Evaluation of Anti-Phishing Toolbars, at NDSS 2007
 
Thinking Outside the Sand[box]
Thinking Outside the Sand[box]Thinking Outside the Sand[box]
Thinking Outside the Sand[box]
 
Beef saurabh
Beef saurabhBeef saurabh
Beef saurabh
 
Load-testing 101 for Startups with Artillery.io
Load-testing 101 for Startups with Artillery.ioLoad-testing 101 for Startups with Artillery.io
Load-testing 101 for Startups with Artillery.io
 
Dealing with legacy code
Dealing with legacy codeDealing with legacy code
Dealing with legacy code
 
CSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on androidCSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on android
 
Ns
NsNs
Ns
 
Velocity building a performance lab for mobile apps in a day - final
Velocity   building a performance lab for mobile apps in a day - finalVelocity   building a performance lab for mobile apps in a day - final
Velocity building a performance lab for mobile apps in a day - final
 
Devouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site ScriptingDevouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site Scripting
 
HTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implicationsHTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implications
 
Derbycon Bromium Labs: Sandboxes
Derbycon Bromium Labs: SandboxesDerbycon Bromium Labs: Sandboxes
Derbycon Bromium Labs: Sandboxes
 

More from Positive Hack Days

Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»
Positive Hack Days
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложений
Positive Hack Days
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Positive Hack Days
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET Core
Positive Hack Days
 

More from Positive Hack Days (20)

Инструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesИнструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release Notes
 
Как мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerКак мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows Docker
 
Типовая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesТиповая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive Technologies
 
Аналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikАналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + Qlik
 
Использование анализатора кода SonarQube
Использование анализатора кода SonarQubeИспользование анализатора кода SonarQube
Использование анализатора кода SonarQube
 
Развитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityРазвитие сообщества Open DevOps Community
Развитие сообщества Open DevOps Community
 
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
 
Автоматизация построения правил для Approof
Автоматизация построения правил для ApproofАвтоматизация построения правил для Approof
Автоматизация построения правил для Approof
 
Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»
 
Формальные методы защиты приложений
Формальные методы защиты приложенийФормальные методы защиты приложений
Формальные методы защиты приложений
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложений
 
Теоретические основы Application Security
Теоретические основы Application SecurityТеоретические основы Application Security
Теоретические основы Application Security
 
От экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летОт экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 лет
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на грабли
 
Требования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОТребования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПО
 
Формальная верификация кода на языке Си
Формальная верификация кода на языке СиФормальная верификация кода на языке Си
Формальная верификация кода на языке Си
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET Core
 
SOC для КИИ: израильский опыт
SOC для КИИ: израильский опытSOC для КИИ: израильский опыт
SOC для КИИ: израильский опыт
 
Honeywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterHoneywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services Center
 
Credential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиCredential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атаки
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Возможно, время не на твоей стороне. Реализация атаки по времени в браузере

  • 1. Time is not on your side:
 Exploiting Browser-Based Timing Attacks by Tom Van Goethem
  • 2. Time is not on your side: Exploiting Browser-Based Timing Attacks About me • Tom Van Goethem! • PhD Student at University of Leuven, Belgium! • Research on security & privacy on the web,
 current focus: side-channel attacks in the browser! • Hacker/Security Researcher/CTFer (HacknamStyle)! • Blog: https://vagosec.org! • : @tomvangoethem 2
  • 3. Time is not on your side: Exploiting Browser-Based Timing Attacks Timing Attacks • Type of side-channel attack! • Observe information from the environment to infer secret/private information! • Known for decades, mainly in cryptography! • Retrieve cryptographic keys! • Exploit secure connections (e.g. Lucky13 attack) 3
  • 4. Time is not on your side: Exploiting Browser-Based Timing Attacks Timing Attack Concept 1. Perform action
 2. Measure time from start to end
 3. Compare/analyse timing measurement
 4. Profit! 4
  • 5. Time is not on your side: Exploiting Browser-Based Timing Attacks Drunkenness Timing Attack 1. Perform action
 → Slap (drunk) person in face! 2. Measure time from start to end
 → start: slap in face, end: slap back! 3. Compare/analyse timing measurement
 → short: not drunk, long: DRUNK!! 4. Profit! 5
  • 6. Drunkenness Timing Attack
 The Experiment Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk?
  • 7. Drunkenness Timing Attack
 The Experiment Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk?
  • 8. Drunkenness Timing Attack
 The Experiment Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk?
  • 9. Drunkenness Timing Attack
 The Experiment Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk?
  • 10. Drunkenness Timing Attack
 The Experiment Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk? Probably not...
  • 11. Drunkenness Timing Attack
 The Experiment Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk? Probably not...
  • 12. Drunkenness Timing Attack
 The Experiment Part 2
  • 13. Drunkenness Timing Attack
 The Experiment (part 2) Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk?
  • 14. Drunkenness Timing Attack
 The Experiment (part 2) Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk?
  • 15. Drunkenness Timing Attack
 The Experiment (part 2) Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk?
  • 16. Drunkenness Timing Attack
 The Experiment (part 2) Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk?
  • 17. Drunkenness Timing Attack
 The Experiment (part 2) Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk? (08.578 > 03.297) YES!
  • 18. Drunkenness Timing Attack
 The Experiment (part 2) Test subject: 
 ! Mathias Bynens (@mathias)
 Timer: Is Mathias drunk? (08.578 > 03.297) YES!
  • 19. Time is not on your side: Exploiting Browser-Based Timing Attacks Timing Attacks • Drunkenness Timing Attacks! • Response time ~ drunkenness! • Cryptographic key recovery! • Execution time ~ bit is 1 or bit is 0! • Lucky 13! • TLS error message time ~ padding information/plaintext! • Web-based Timing Attacks! • .... 13
  • 20. Time is not on your side: Exploiting Browser-Based Timing Attacks Web-based Timing Attacks • Known since 2000!! • Pixel Perfect (by Paul Stone, 2013)! • GPU rendering time ~ pixel color! • JS comparison timing attack (by @sirdarckcat, 2013)! • JS execution time ~ attacker input + secret data! • Direct timing attack! • Cross-site timing attack 14 (by Bortz & Boneh, 2007)
  • 21. Time is not on your side: Exploiting Browser-Based Timing Attacks Direct Timing Attack 15 username password batman b4tm4n
  • 22. Time is not on your side: Exploiting Browser-Based Timing Attacks POST /login/! ! username=batman
 &password=aaa
 Direct Timing Attack 15 username password batman b4tm4n
  • 23. Time is not on your side: Exploiting Browser-Based Timing Attacks Direct Timing Attack 16 username password batman b4tm4n
  • 24. Time is not on your side: Exploiting Browser-Based Timing Attacks POST /login/! ! username=batman
 &password=baa
 Direct Timing Attack 16 username password batman b4tm4n
  • 25. Time is not on your side: Exploiting Browser-Based Timing Attacks Direct Timing Attack • Many limitations! • Network irregularities! • Concurrent users! • ...! • Many “solutions”! • Get VM on same cloud machine (e.g. AWS)! • Use very precise timing methods! • Use statistical tests 17
  • 26. Time is not on your side: Exploiting Browser-Based Timing Attacks Cross-site Timing Attacks • Request to the server is sent by victim! • Cookies are attached to the request! • Response is specific to the state of the user! • example: logged in → large response 
 not logged in → small response! • Attacker measures response time with JS! • Bypasses Same-Origin Policy 18
  • 27. Time is not on your side: Exploiting Browser-Based Timing Attacks Same-Origin Policy • Main security principle of the web!! • attacker.com can not read anything from example.com! • The length of the resources is also secret! • With only length information, attacker can infer a lot of private information (see demo later) 19
  • 28.
  • 30.
  • 32.
  • 34. Time is not on your side: Exploiting Browser-Based Timing Attacks Classic Cross-site Timing Attacks • Classic timing attacks have several limitations! • Network irregularities! • gzip compression! • Round-trip for each measurement! • Rate-limiting 23
  • 35. Time is not on your side: Exploiting Browser-Based Timing Attacks Browser-based Timing Attacks • Timing attacks in browsers overcome these limitations! • Timing measurement starts after resource is downloaded! • Measurements are more accurate! • For some attacks: resource is only downloaded once! • Obtain multiple measurements in short interval 24
  • 36.
  • 38. Time is not on your side: Exploiting Browser-Based Timing Attacks Browser-based Timing Attacks • Side-channels allow measuring time to process resource! • Parse as specific format (~ CPU processing time)! • Retrieve from cache (~ disk read time)! • Store in cache (~ disk write time) 26
  • 39. The Clock is Still Ticking: Timing Attacks in the Modern Web Video Parsing Attack 27 var video = document.createElement('video'); ! // suspend => download complete video.addEventListener('suspend', function(){ startMeasurement(); }); ! // error => parsing complete video.addEventListener('error', function(){ stopMeasurement(); }); ! video.src = 'http://example.org/resource';
  • 40. The Clock is Still Ticking: Timing Attacks in the Modern Web Cache Storing Attack 28 var resource = 'http://example.org/resource'; var foo = new Request('foo'); fetch(resource).then(function(resp) { // Resource download complete startMeasurement(); return cache.put(foo, resp.clone()) }).then(function() { // Resource stored in cache stopMeasurement(); });
  • 41. ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 2500 5000 7500 25 50 75 100 Difference in file size (kB) Avg.timetoperformtimingattack(ms) ● Classic timing attack Video parsing attack Cache storing attack Cache + video parsing
  • 42. Demo
  • 43.
  • 44. Time is not on your side: Exploiting Browser-Based Timing Attacks Age-discovery Attack 1. Create Facebook posts, each targeted to users of a specific age! 2. Discover age-range of the user! • Fetch corresponding resources! • Obtain timing measurements! • Determine age-range according to the value of timing measurements! 3. Discover exact age of the user! • Repeat (2) but for posts targeted to specific age 32
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51. Time is not on your side: Exploiting Browser-Based Timing Attacks Mitigation • Client-side! • Non-trivial! • Reduce timer resolution: ms resolution sufficient! • Timing side-channels exist by the browser design! • Disable 3rd-party cookies? SameSite cookies?! • Server-side! • Cause is related to CSRF! • Prevent illegitimate cross-origin requests 36
  • 52. Time is not on your side: Exploiting Browser-Based Timing Attacks “It seems like this is very similar to another report about cache- based side channel attacks from "The spy in the sandbox," so I'm marking this as a duplicate.” “This isn't an issue Firefox can solve on its own; much of it is inherent in the design of the features. After the paper is published we can work with Chrome folks and other browser vendors to see if there are any reasonable ways to address this” Mitigation! (current status) 37 https://bugzilla.mozilla.org/show_bug.cgi?id=1211669 https://code.google.com/p/chromium/issues/detail?id=539390
  • 53. Time is not on your side: Exploiting Browser-Based Timing Attacks Conclusion • Novel browser-based timing attacks! • Timing measurement starts after resource is downloaded! • Faster & more robust than classic timing attacks! • Side-channels exist by design! • Many major popular web applications are vulnerable! • Mitigation is challenging 38
  • 54. Time is not on your side: Exploiting Browser-Based Timing Attacks Questions? 39 : @tomvangoethem
  • 55. Time is not on your side: Exploiting Browser-Based Timing Attacks Questions? 39 : @tomvangoethem
  • 56. Time is not on your side: Exploiting Browser-Based Timing Attacks Mitigation! (current status) “We ended up discussing this at length with the Facebook Security Team, and at the time we do not plan to make any changes to our site.”! ! [geographic location of a user]: “This information is not expected to be private, so we don't consider that aspect a vulnerability.”
 [connection status of users]: “If it is possible to exploit in the manner described, we would like to address this.”
 “The relationship of a member to a company is not considered private information on our site, so we don't consider that aspect a vulnerability.” 40
  • 57. Time is not on your side: Exploiting Browser-Based Timing Attacks AppCache attack • Specify which resources need to be cached! • This include cross-origin resources! • After caching, measure time required to load resources! • Time between setting src and onerror on images • Often too fast for accurate measurement! • → load resources multiple times! • Resources only need to be downloaded once 41
  • 58. Time is not on your side: Exploiting Browser-Based Timing Attacks Cache storing attack • Can be done using ServiceWorkers! • Lifetime independent of the web page that created them! • Works even when user is offline! • Resources only need to be downloaded once 42
  • 59. ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 2500 5000 7500 25 50 75 100 Difference in file size (kB) Avg.timetoperformtimingattack(ms) ● Application Cache Basic Cache + video parsing Script parsing Service Workers Video parsing