Critical Flaws Found in Widely Used Python Library

TL;DR: A popular Python library for authentication, OAuthLib, has two critical security flaws. These could allow attackers to run malicious code or take over user accounts, putting many applications that rely on it at risk.
Key facts
- Category
- Cybersecurity
- Impact
- Critical
- Published
- Source
- Ubuntu Security Notices
Full summary
A widely used Python authentication library has critical flaws that could let attackers run code or take over user accounts.
A security notice from Ubuntu has detailed two critical vulnerabilities in OAuthLib, a highly popular and foundational Python library for implementing OAuth authentication. The flaws expose applications using the library to severe risks, including remote code execution (RCE) and potential account takeovers. OAuth is the standard protocol that allows services like Google or GitHub to securely authenticate users for third-party applications without sharing passwords. Because OAuthLib is a core dependency in many web frameworks and services, the impact of these vulnerabilities is widespread, creating an urgent need for developers and security teams to take action. The notice highlights the fragility of the software supply chain, where a single flaw in a common building block can create systemic risk across countless systems that depend on it.
The first vulnerability, identified as CVE-2026-49264, involves the incorrect handling of JSONP callback parameters. JSONP is a method used by web developers to overcome browser restrictions on making requests to different domains. The flaw exists in OAuthLib’s token revocation endpoint, which is used to invalidate a user's access token. An attacker could craft a malicious callback parameter that, when processed by a vulnerable client application, could lead to the execution of arbitrary code. The second issue concerns the library's implementation of Proof Key for Code Exchange (PKCE), a security extension for OAuth. The library was found to be comparing PKCE code verifiers using a method that was not “constant-time.” This means the comparison took a slightly different amount of time depending on how much of the secret code was correct. An attacker could exploit this by repeatedly sending guesses and measuring the server’s response time, allowing them to reconstruct the secret verifier one character at a time in what is known as a timing attack. A successful timing attack could allow an attacker to bypass PKCE protections and potentially hijack a user's session.
The discovery of these OAuthLib vulnerabilities underscores a persistent challenge in modern software development: securing the open-source supply chain. OAuthLib is not just a standalone tool; it is a dependency integrated into major Python frameworks such as Django REST Framework and Flask-OAuthlib, among others. This means that thousands of applications, from small internal tools to large-scale enterprise platforms, may be vulnerable without their developers even being directly aware they are using the library. This incident serves as a powerful reminder that a project's security posture is only as strong as its weakest dependency. It echoes the impact of past vulnerabilities in widely used libraries like Log4j or OpenSSL, where a single point of failure created a massive, industry-wide scramble to patch systems. The reliance on a shared ecosystem of open-source components enables rapid development but also concentrates risk, making robust dependency management a non-negotiable aspect of security.
For engineering and security leaders, the immediate takeaway is the need for a swift and thorough response. The first step is to conduct a comprehensive audit of all software projects to determine if and where OAuthLib is being used, either as a direct dependency or as a transitive one pulled in by another library. Once identified, all instances must be updated to a patched version. This incident also highlights the critical importance of implementing automated security tooling within the development lifecycle. Tools that scan for vulnerable dependencies and flag them during the build process can prevent such issues from ever reaching production. Looking ahead, teams should treat dependency management not as a one-time fix but as a continuous process of monitoring, auditing, and patching. The security landscape is dynamic, and maintaining a proactive stance on software supply chain hygiene is the only effective way to mitigate the inevitable discovery of future vulnerabilities in the open-source tools we all rely on.
Why it matters
OAuthLib is a foundational component in many Python web frameworks for handling authentication. These vulnerabilities could allow attackers to bypass security controls, leading to remote code execution or account takeovers, directly compromising application integrity and user data.
Business impact
Applications using the vulnerable library are at high risk of data breaches and unauthorized access. A successful exploit could lead to significant financial loss, reputational damage, and regulatory fines. Immediate developer time is required to audit dependencies and apply patches.
⚡ Action needed
All teams using OAuthLib or libraries that depend on it must update to a patched version immediately to mitigate these critical vulnerabilities.
Action checklist
- 1Identify all projects using the OAuthLib Python library directly.
- 2Use dependency analysis tools to find projects that use OAuthLib indirectly.
- 3Update OAuthLib to the latest patched version across all affected applications.
- 4Review application logs for any signs of suspicious authentication activity.
- 5Verify that your CI/CD pipeline automatically scans for newly disclosed vulnerabilities.
Tags
Related on Notifire
Related stories
Primary source: Ubuntu Security Notices