GHSL-2020-228: Weak JSON Web Token (JWT) signing secret in YApi - CVE-2021-27884
The application used a weak pseudo-random number generator to create the secret used to sign JSON Web Tokens (JWTs). An attacker could brute-force the generator's state from observed tokens and then forge tokens for other users, though the cost was estimated at thousands of dollars.
The latest commit to the date: 8e1f654.
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 report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could forge JWTs for other users, but the brute-force attack was estimated to cost between $8,000 and $24,000 using cloud computing, and the 7-day token expiration did not limit the attack because the target was the passsalt value.
What the attacker needed
Ability to create new user accounts; cloud computing resources (cost $8k–$24k)
How it was found
- Automate the user creation process to obtain three new user tokens rapidly.
- Brute-force the JWT HMAC signatures to recover the internal state of Math.random.
- Recreate the passsalt values used to sign tokens of other users.
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 report has not been written yet. The Original tab links to the source.
A JSON Web Token (JWT) is like a signed pass that a website gives you after you log in. The signature proves the pass is real, and it is made using a secret key. Here, that secret key was generated using a random number generator that is not truly random, so someone could figure out the key and create fake passes for other users.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.