Intel

AIKIDO-2026-600799

django-oauth-toolkit is vulnerable to Use of Insufficiently Random Values

Use of Insufficiently Random Values Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 5 days ago

53

Medium Risk

This Affects:

PYTHONdjango-oauth-toolkit
3.2.0 - 3.3.0
Fixed in 3.4.0
Are you affected? Scan for Free

TL;DR

The OAuth 2.0 device authorization grant generates the user_code credential with the non-cryptographic random module (Mersenne Twister), whose output is predictable once its internal state is inferred. The device views look up pending grants solely by user_code, so a guessable code lets an attacker bind or hijack a device authorization. The fix draws each character from the cryptographically secure secrets module as required by RFC 8628.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your deployment enables the OAuth 2.0 device authorization grant.

Background info

django-oauth-toolkit is vulnerable to Use of Insufficiently Random Values in versions 3.2.0 - 3.3.0.

How to fix this

Upgrade the django-oauth-toolkit library to the patch version.