Breaking Client-Side Encryption for Bounties by Samuel Orellana aka samux (Translated by Google Lens)
As this talk is in Spanish which I don't speak, but the subject matter is a huge interest. I've employed Google to translate the slides. The original talk can be viewed here
---
A quick Intro
My name is Samuel Orellana (aka samux). I have been dedicated to cybersecurity for more than ten years, and in February I complete a decade actively participating in bug bounty programs. I am currently a HackerOne Ambassador in Chile, I have participated in Live Hacking Events around the world and I am part of the platform's Global Top 50.
Besides all that, I love cats.
---
Agenda - Introduction to Client-Side Encryption (CSE).
- CSE and Server-Side Encryption (SSE).
- Types of client-side ciphers.
- Vulnerability detection process.
- Vulnerabilities detected in Bug Bounty programs.
- Conclusions and recommendations.
---
Introduction to Client-Side Encryption (CSE)
- CSE is the process of encrypting sensitive data directly in the user's web browser (the client) before it is transmitted to the server.
- The encryption process is done through JavaScript, which is why developers generally trust that this cannot be breached.
---
CSE and Server-Side Encryption (SSE)
To increase the degree of security, developers often choose to add an additional encryption layer. This is achieved by implementing a server-side encryption (SSE) mechanism, with the objective of preventing the analysis or exposure of data, both in the client and server environments.
---
Yeah but, can server-side encryption be vulnerable?
---
ENOUGH WITH ALL THE SMOKE AND MIRROR, HACK IT ALREADY, DAMMIT!
---
Types of client-side ciphers
Crypto JS
Web Crypto API
Ciphers with SDK (AWS, Azure)
How to identify them?
Crypto JS
crypto-js CryptoJS.AES.encrypt CryptoJS.AES.decrypt CryptoJS.*
Web Crypto ΑΡΙ
crypto.subtle window.crypto.subtle.encrypt crypto.subtle.generateKey subtle.encrypt subtle.decrypt
SDK (AWS, Azure)
aws-sdk @aws-crypto/client-browser azure-storage
---
Vulnerability detection process
The objective of detecting vulnerabilities in the encryption mechanism is based on manipulating data before it is encrypted; therefore, it is necessary to find JavaScript files where the encryption logic is located and then debug them to be able to manipulate them.
---
Vulnerability detection process
Firefox
1. Open the browser, right click, inspect element
2. Click on the debugger (in the middle)
3. A window will open on the left where you can search for everything necessary to break CSE.
---
Vulnerability detection process
Chrome
1. Open the browser, right click, inspect element
2. Top right corner click on "search"
3. A window will open on the left where you can search everything necessary to break CSE.
---
Demo 1
---
Vulnerability detection process
Search for keywords to find where the encryption process is performed (name of encryption libraries, name of endpoints, name of variables, etc.).
Manipulate the information and continue with the flow.
A little more tedious but if possible, analyze each jump of the debugger in order to find sensitive information, etc.
IMPORTANT: If the variable does not allow direct editing on the debugger, manipulate it directly from the console.
---
Full Account Takeover 0 click without user interaction
Demo 2
BOUNTY: $5000
---
Full PII of any registered user
Demo 3
BOUNTY: $3000
---
Total vulnerabilities detected
Vulnerability - Bounty
Full ATO (without interaction) - $5000
Full ATO (without interaction) X2 - $6000
Jira exposed credentials within encryption mechanism logic (*) - $5000
Bypass 2FA $3000
Full PII of any registered admin user - $3000
Full (PII) of any registered user - $3000
Security questions can be changed for any user - $3000
Passwords can potentially be changed for any user - $1500
Disclosure of registered email, name, and last name is possible - $1000
$30,500 Bounties
---
Conclusions and recommendations
Just because it's encrypted doesn't mean it can't be breached.
Always analyze the behavior of JavaScript.
JavaScript for hackers - Gareth Heyes (https://leanpub.com/javascriptforhackers-es)
Jsmon (https://jsmon.sh/).
Adopt a cat!!! 🐱
---
Thank you
@saamux












