When Client-Side Encryption Becomes a Security Blanket
The application encrypted request bodies client-side, but the encryption logic was shipped to the browser, allowing an attacker to reverse-engineer it and forge valid requests. This exposed multiple vulnerabilities including broken access control, account takeover via password reset and MFA brute force, unauthenticated SQL injection, unauthorized access to private files, and hardcoded backup information in JavaScript.
medium.com
Published on medium.com
Now and then you get an engagement that hands you a lesson so clean you almost want to frame it. This was one of those.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the developers relied on client-side encryption as a security control and neglected proper server-side authorization, authentication, input validation, and access checks.
Impact
An attacker could take over any account including admins, access private files without authentication, execute SQL injection, and obtain sensitive backup details, potentially leading to full system compromise.
What the attacker needed
Access to the application; ability to intercept and modify requests; a valid user account; no rate limiting on OTP
The fix
The application should implement proper server-side authorization, authentication, input validation, and access control instead of relying on client-side encryption.
How it was found
- Capture encrypted requests in Burp Suite and note that responses are plain text.
- Read the main JavaScript file to extract encryption logic and API endpoints.
- Rebuild the encryption algorithm to forge valid requests.
- Use a normal user's JWT to access admin APIs and create an admin user.
- Change another user's password via the setNewPassword endpoint without knowing the old password.
- Brute-force the MFA OTP because there is no rate limiting.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The app tried to hide what it was sending by encrypting requests in the browser, but since the browser must know how to encrypt, an attacker can read that code and do the same. Once the encryption was bypassed, the tester found many basic security mistakes, like letting normal users do admin actions, changing anyone's password, and reading private files without logging in.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.