Skip to main content
Vulnerability Database/CVE-2026-49264

CVE-2026-49264: OAuthLib JSONP Callback XSS Vulnerability

CVE-2026-49264 is a cross-site scripting vulnerability in OAuthLib that allows attackers to execute malicious JavaScript through unvalidated JSONP callbacks. This article covers the technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-49264 Overview

CVE-2026-49264 is a reflected cross-site scripting (XSS) vulnerability in OAuthLib, a Python implementation of OAuth request-signing logic. The flaw resides in the RevocationEndpoint component at oauthlib/oauth2/rfc6749/endpoints/revocation.py. When operators enable the enable_jsonp=True option, the endpoint reflects the callback request parameter into success and error response bodies without validating that the value is a legal JavaScript function name. Affected versions span from 0.6.1 up to but not including 4.0.0. The issue is categorized under [CWE-79] (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Attackers can execute arbitrary JavaScript in the context of any browser application that loads the revocation response as trusted JSONP, gaining access to the including application's DOM and script-accessible data.

Affected Products

  • OAuthLib versions 0.6.1 through 3.x (fixed in 4.0.0)
  • Python 3.6+ applications using the OAuth2 provider RevocationEndpoint
  • Deployments that explicitly set enable_jsonp=True on the revocation endpoint

Discovery Timeline

  • 2026-10-13 - CVE-2026-49264 published to NVD
  • 2026-10-13 - Last updated in NVD database

Technical Details for CVE-2026-49264

Vulnerability Analysis

OAuthLib's token revocation endpoint historically supported JSONP to allow cross-origin browser clients to receive revocation responses. When enable_jsonp=True, the endpoint accepts a callback parameter from either the query string or request body. The endpoint then wraps the JSON response in a function call using that parameter value. Because the server does not restrict the callback to a legal JavaScript identifier, an attacker can supply arbitrary JavaScript code as the callback value.

A browser application that loads the revocation response as a <script> tag will execute the attacker-supplied payload in its own origin. The payload gains full access to the DOM, cookies accessible to scripts, and any session state. User interaction is required to trigger the request, and the scope changes because the code runs in the including application's origin rather than the OAuth server's origin.

Root Cause

The root cause is missing input validation on the callback parameter in the JSONP response path. The RFC for JSONP implicitly requires that callback values be restricted to a strict subset matching JavaScript identifier syntax. OAuthLib echoed the raw value into executable response bodies without applying an allowlist regex such as ^[a-zA-Z_$][0-9a-zA-Z_$]*$.

Attack Vector

An attacker crafts a URL to the revocation endpoint containing malicious JavaScript in the callback parameter. The attacker then lures a user of a vulnerable browser application into loading a page that includes the revocation response as a trusted JSONP source. The browser executes the attacker-controlled code with the privileges of the including application.

The maintainers resolved the issue by removing JSONP support entirely rather than attempting to sanitize callbacks. The following patch excerpt from the client base shows the removal of the callback parameter from prepare_token_revocation_request:

python
        return token_url, FORM_ENC_HEADERS, body

    def prepare_token_revocation_request(self, revocation_url, token,
                                         token_type_hint="access_token", body='', **kwargs):
        """Prepare a token revocation request.

        :param revocation_url: Provider token revocation endpoint URL.

Source: GitHub Commit c888359

The accompanying changelog entry documents the breaking change:

text
OAuth2.0 Provider:
* **Breaking**: Removed JSONP support from token revocation endpoint.
  JSONP has been superseded by CORS for cross-origin requests.
  The ``enable_jsonp`` parameter has been removed from ``RevocationEndpoint``
  and the ``callback`` parameter has been removed from ``prepare_token_revocation_request``.

Source: OAuthLib Release v4.0.0

Detection Methods for CVE-2026-49264

Indicators of Compromise

  • HTTP requests to the token revocation endpoint containing a callback query parameter with characters outside standard JavaScript identifier syntax (parentheses, semicolons, angle brackets, quotes).
  • Response bodies from the revocation endpoint with Content-Type: application/javascript wrapping arbitrary code.
  • Referrer logs showing third-party pages loading the revocation endpoint via <script src=...>.

Detection Strategies

  • Audit OAuth2 provider configuration for any instantiation of RevocationEndpoint(enable_jsonp=True) in deployed codebases.
  • Enable web application firewall (WAF) rules that inspect the callback parameter on revocation URLs and reject non-identifier values.
  • Review installed OAuthLib versions across Python environments using pip show oauthlib or SCA tooling to identify versions below 4.0.0.

Monitoring Recommendations

  • Monitor access logs for anomalous query strings on /revoke or equivalent revocation routes.
  • Alert on outbound script-type responses from OAuth endpoints to unexpected referrers.
  • Track dependency manifests (requirements.txt, pyproject.toml, Pipfile.lock) for pinned OAuthLib versions below 4.0.0.

How to Mitigate CVE-2026-49264

Immediate Actions Required

  • Upgrade OAuthLib to version 4.0.0 or later across all Python environments and container images.
  • Set enable_jsonp=False on any RevocationEndpoint instance that cannot be immediately upgraded.
  • Remove client-side usage of the callback parameter in calls to prepare_token_revocation_request.

Patch Information

The fix ships in OAuthLib 4.0.0, which removes JSONP support from the token revocation endpoint entirely. Both the enable_jsonp parameter on RevocationEndpoint and the callback parameter on prepare_token_revocation_request have been removed as a breaking change. See the GitHub Security Advisory GHSA-hj66-6f7g-4r5v and Pull Request 951 for complete details.

Workarounds

  • Disable JSONP on the revocation endpoint by omitting or setting enable_jsonp=False when constructing the provider.
  • Place a reverse proxy or WAF rule in front of the revocation endpoint that strips or validates the callback parameter against ^[a-zA-Z_$][0-9a-zA-Z_$]*$.
  • Migrate browser-based cross-origin revocation flows to CORS-based requests, which supersede JSONP for this use case.
bash
# Upgrade OAuthLib to the patched release
pip install --upgrade 'oauthlib>=4.0.0'

# Verify the installed version
pip show oauthlib | grep -i version

# Audit source for vulnerable configuration
grep -R "enable_jsonp" ./ --include="*.py"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.