Skip to content
Crypto Write-up Advanced

CVE-2026–41505: How a Two-Letter Import Broke Authentication Se

RELATE used Python's non-cryptographic random module to generate password reset and sign-in tokens and exam ticket codes. An attacker who observes enough outputs could reconstruct the generator state and predict future tokens, potentially taking over accounts or accessing exams.

Ruslan Amrahov Follow

Published on medium.com

In April 2026, I discovered a security vulnerability in RELATE — an open-source course management system developed by Andreas Kloeckner at the University of Illinois. The vulnerability was rooted in a single line of Python code:

Ruslan Amrahov, on medium.com

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

The code used Python's random module, which is a non-cryptographic pseudo-random number generator, to create security-sensitive tokens instead of a cryptographically secure source.

Impact

An attacker could predict password reset and sign-in tokens to take over any account, and predict exam ticket codes to gain unauthorised exam access; the text notes the attack requires about 156 requests and state recovery.

What the attacker needed

Network access to the RELATE instance; ability to create accounts and trigger resets; about 156 reset requests to recover state

The fix

The random module was replaced with Python's secrets module, which uses the operating system's cryptographically secure random source, and the text states the vulnerability was fixed within 48 hours.

How it was found

  1. Create many accounts and repeatedly trigger password reset requests to collect generator outputs.
  2. Collect about 156 reset requests, each producing four 32-bit outputs, to reach 624 words and reconstruct the generator state.
  3. Estimate the server time from HTTP response headers.
  4. Trigger a password reset for the victim and compute the predicted token from the known email, predicted random output and estimated time.
  5. Use the predicted token to reset the victim's password and take over the 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.

Computers can make 'random' numbers in two ways: a fast method that is fine for games but predictable if you watch enough of its output, and a slow, secure method meant for passwords and tokens. This project used the fast method for login links and exam codes, so someone who collected enough of those codes could work out the pattern and guess the next ones. That could let them reset someone else's password or get into an exam.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by Ruslan Amrahov

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.