CVE-2026-49264
OAuthLib revocation endpoint JSONP callback injection leads to XSS when enable_jsonp=True.
- CVSS 6.1
- CWE-79
- Input Validation and Sanitization
- Remote
OAuthLib is an implementation of the OAuth request-signing logic for Python 3.6+. From 0.6.1 until 4.0.0, OAuthLib's RevocationEndpoint in oauthlib/oauth2/rfc6749/endpoints/revocation.py reflects an unvalidated callback request parameter into success and error response bodies when enable_jsonp=True. The callback can come from the query string or request body and is used without restricting it to a legal JavaScript function name. A browser application that loads the revocation response as trusted JSONP and permits attacker influence over callback can therefore execute attacker-controlled JavaScript in the including application's origin, with access to its DOM and script-accessible data. The feature is disabled by default, so only deployments that explicitly enable JSONP are affected. This issue is fixed in version 4.0.0.
- CWE
- CWE-79
- CVSS base score
- 6.1
- Published
- 2026-10-13
- OWASP
- A03 Injection
- Orthogonal defect classification
- Interface
- Code defect classification
- Incorrect Interface
- Category
- Input Validation and Sanitization
- Subcategory
- Cross-Site Scripting (XSS)
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- OAuthLib
- Fixed by upgrading
- Yes
Solution
Upgrade OAuthLib to version 4.0.0 (or later).
Vulnerable code sample
from oauthlib.oauth2 import RequestValidator, RevocationEndpoint
from oauthlib.common import Request
class SimpleValidator(RequestValidator):
def validate_revocation_request(self, request):
return True
# VULNERABLE: unsanitized JSONP callback reflected in response
def handle_revocation(environ):
request = Request.from_wsgi(environ)
validator = SimpleValidator()
endpoint = RevocationEndpoint(validator, enable_jsonp=True)
return endpoint.create_response(request)Patched code sample
from oauthlib.oauth2 import RequestValidator, RevocationEndpoint
from oauthlib.common import Request
import re
class SimpleValidator(RequestValidator):
def validate_revocation_request(self, request):
return True
# FIX: validate JSONP callback name before reflecting
def handle_revocation(environ):
request = Request.from_wsgi(environ)
validator = SimpleValidator()
endpoint = RevocationEndpoint(validator, enable_jsonp=True)
# sanitize callback if present
callback = request.body.get('callback') or request.query.get('callback')
if callback and not re.fullmatch(r'[A-Za-z_][A-Za-z0-9_]*', callback):
raise ValueError('Invalid JSONP callback')
return endpoint.create_response(request)Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Remove JSONP support from token revocation (oauthlib/oauthlib)
oauthlib/oauth2/rfc6749/clients/base.py · Client.prepare_token_revocation_request,oauthlib/oauth2/rfc6749/endpoints/revocation.py · RevocationEndpoint.create_revocation_response,oauthlib/oauth2/rfc6749/endpoints/revocation.py · RevocationEndpoint.__init__,oauthlib/oauth2/rfc6749/parameters.py · prepare_token_revocation_request
Cite this entry
@misc{vaitp:cve202649264,
title = {{OAuthLib revocation endpoint JSONP callback injection leads to XSS when enable_jsonp=True.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-49264},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-49264/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
