Hackeando Wordle
The daily Wordle solution was stored in the browser's local storage, encrypted with AES and then Base64-encoded. An attacker could reverse-engineer the client-side code to decrypt the solution and reveal the word of the day.
Published on infosecwriteups.com
Como seguro que le ha pasado a más de uno, me he convertido en un adicto al Wordle, el nuevo juego de moda inventado por Josh Wardle, por el que el New York Times pagó una cifra de 7 dígitos.
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 encryption key and algorithm were embedded in client-side JavaScript, so the 'encryption' provided no real secrecy.
Impact
An attacker could reveal the word of the day and any future solution up to 11 September 2023, spoiling the game for themselves or others.
What the attacker needed
Access to the game's web page; ability to use browser developer tools
The fix
The encryption key should not be stored on the client; a server should manage the secret key, though the author notes this is acceptable for a low-stakes game.
How it was found
- Open the browser's developer tools and inspect local storage.
- Find the 'solution' variable and notice it is Base64-encoded.
- Decode the Base64 to see it is encrypted data.
- Search the source code for the decryption function.
- Set a breakpoint and call the decryption function with the stored solution.
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 game stored the answer to each day's puzzle in the player's own browser, scrambled with a simple code. Because the scrambling key was also in the browser, anyone who looked at the code could unscramble it and see the answer before playing.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.