Ciphered Chaos: Bit-Flipping in the Wild
The application used AES-CBC encryption for account IDs without integrity checks and returned verbose errors that revealed partially decrypted plaintext. An attacker could perform a bit-flipping attack to forge encrypted account IDs for other customers, enabling IDOR or broken access control.
Answering the long existing conflict of whether or not most CTFs do not relate to the real world pentest/bug hunting scenarios. Short answer is: Yes, they do relate big time, and without prior CTF expertise we probably wouldn’t have found this bug.
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 use of AES-CBC encryption without a message authentication code (MAC) or integrity check, combined with verbose error messages that revealed partially decrypted plaintext.
Impact
An attacker could forge encrypted account IDs to access other customers' accounts, potentially leading to unauthorized fund transfers or data disclosure, though the report does not demonstrate actual exploitation beyond token forgery.
What the attacker needed
Access to the banking application; ability to intercept and modify requests
The fix
The application should implement integrity validation (e.g., a MAC) on encrypted values and avoid verbose error messages that leak plaintext.
How it was found
- Observe that account IDs are encrypted and sent in transfer and account summary requests.
- Change a byte in the encrypted account ID and observe a verbose error with partially decrypted plaintext.
- Change bytes from the other end to extract the full plaintext, confirming AES-CBC.
- Add control blocks and use the tilde separator to craft a new plaintext with a different account number.
- Brute-force bytes to get readable characters and apply XOR to forge the encrypted token.
- Use the forged token in requests to access another customer's account.
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 scrambled account numbers using a common encryption method (AES-CBC) but didn't add a tamper check. By changing a few characters in the scrambled text, the attacker could make the app unscramble it into a different account number. The app also showed detailed error messages that leaked parts of the unscrambled data, helping the attacker.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.