CVE-2013-4347: Weak Random Number Generation in oauth2

oauth2 Updated 02 Oct 2025

Summary

17/05/2022
Yes i
Moderate
3.7

CVE-2013-4347: SimpleGeo python-oauth2 vulnerable to the use of Insufficiently Random Values to generate nonces. Affects oauth2 versions < 1.9rc1. Fixed in 1.9rc1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The oauth2 package is a Python library that provides support for OAuth 1.0 and 2.0 authentication protocols. It allows developers to integrate OAuth functionality into their applications, enabling secure authorization and authentication with various service providers. However, a vulnerability has been identified in the package's implementation of nonce generation, which can lead to weak random number generation.

Vulnerability Detail

The vulnerability exists in the make_nonce, generate_nonce, and generate_verifier functions of the oauth2 package. These functions use weak random numbers to generate nonces, making it easier for remote attackers to guess the nonce through brute force attacks. This can potentially compromise the security of the OAuth authentication process and allow unauthorized access to protected resources.

How To Fix

Minimum fixed version

1.9rc1

This is the first release that contains the fix.

pip install --upgrade "oauth2==1.9rc1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround provided for this vulnerability. However, users can mitigate the risk by updating the oauth2 package to the recommended version as mentioned in the 'how_to_fix' section.

Conclusion

The oauth2 package is vulnerable to weak random number generation in nonce generation, which can be exploited by remote attackers to guess nonces and potentially gain unauthorized access to protected resources. To mitigate this vulnerability, it is recommended to update the package to version 1.9rc1 or later. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for oauth2 →

Share this vulnerability

FAQ

The vulnerability allows remote attackers to guess nonces used in the OAuth authentication process, potentially leading to unauthorized access to protected resources.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your Pipfile.lock file, and Vulert will analyze it for any open-source vulnerabilities, including this one.

There are no known public exploits available for this vulnerability at the time of this report. However, it is still crucial to address the issue promptly to prevent potential unauthorized access.

There are alternative OAuth libraries and packages available in the Python ecosystem, such as oauthlib and requests-oauthlib. Consider evaluating these alternatives if you require OAuth functionality and want to avoid the vulnerability in oauth2.

You can find more information about this vulnerability, including its technical details and the fix, in the advisory database of the Python Package Index (PyPI) at https://github.com/pypa/advisory-database/blob/main/vulns/oauth2/PYSEC-2014-86.yaml.

Related vulnerabilities

Recent vulnerabilities recorded for oauth2.

How To Fix

Minimum fixed version

1.9rc1

This is the first release that contains the fix.

pip install --upgrade "oauth2==1.9rc1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback