CVE-2025-65431
Python vulnerability analysis and mitigation

Overview

CVE-2025-65431 is an improper authentication vulnerability in django-allauth affecting its Okta and NetIQ third-party provider integrations. The flaw stems from both providers using preferred_username — a mutable claim — as the identifier for third-party provider accounts, which is unsuitable for authorization decisions. All versions of django-allauth (pip package django-allauth) before 65.13.0 are affected. The vulnerability was published on December 15, 2025, with a patch released in version 65.13.0. It carries a CVSS v3.1 base score of 5.4 (Medium/Moderate) (GitHub Advisory).

Technical details

The root cause is classified as CWE-287 (Improper Authentication): django-allauth's Okta and NetIQ provider implementations relied on the preferred_username OpenID Connect claim to identify and link user accounts, rather than the immutable sub (subject) claim (GitHub Advisory). Because preferred_username is a mutable value that can be changed by an identity provider administrator or, in some configurations, by the user themselves, an attacker who can influence or take over a preferred_username value could potentially be associated with a different user's account in the application. The fix replaces preferred_username with sub — the stable, unique, and immutable subject identifier mandated by the OpenID Connect specification — for both Okta and NetIQ providers (allauth release notes).

Impact

Successful exploitation could allow an authenticated attacker to impersonate another user's account within a Django application using Okta or NetIQ as an identity provider, resulting in unauthorized access to that user's data and functionality (confidentiality and integrity impact). The vulnerability does not affect availability. The scope is limited to applications using django-allauth with Okta or NetIQ social login providers, but within those applications, account takeover of arbitrary users is theoretically possible if an attacker can manipulate the preferred_username claim (GitHub Advisory).

Exploitability

There is no public evidence of active in-the-wild exploitation of CVE-2025-65431, and no exploit code or proof-of-concept has been publicly disclosed. The EPSS score is approximately 0.039% (12th percentile), indicating a low near-term exploitation probability (GitHub Advisory). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires the attacker to have low-level privileges (e.g., an existing account in the identity provider) and the ability to control or influence the preferred_username attribute, which may require administrative access to the IdP in many configurations.

Exploitation steps

  1. Identify target application: Locate a Django application using django-allauth (version < 65.13.0) configured with Okta or NetIQ as a social/SSO login provider.
  2. Control a preferred_username value: As an attacker with access to the identity provider (e.g., an IdP admin, or in environments where users can self-modify their preferred_username), change your own preferred_username to match the preferred_username of a target victim account.
  3. Initiate OAuth/OIDC login: Trigger the social login flow through the django-allauth Okta or NetIQ provider endpoint, authenticating as your own IdP account.
  4. Account association: Because django-allauth uses preferred_username to look up and link provider accounts, the application associates your login session with the victim's existing account rather than your own.
  5. Gain unauthorized access: You are now authenticated as the victim user within the Django application, gaining access to their data, sessions, and permissions (GitHub Advisory).

Indicators of compromise

  • Logs: Django application authentication logs showing a user account linked to an unexpected or recently changed preferred_username value; login events from an Okta or NetIQ account where the preferred_username does not match historical values for that account.
  • Application Behavior: Multiple distinct IdP accounts resolving to the same django-allauth social account record; unexpected account merges or re-associations in the socialaccount_socialaccount database table.
  • Identity Provider Audit Logs: Audit events in Okta or NetIQ showing recent changes to a user's preferred_username attribute, particularly if followed shortly by a login to the target application.

Mitigation and workarounds

Upgrade django-allauth to version 65.13.0 or later, which replaces preferred_username with the immutable sub claim for both Okta and NetIQ provider account identification (GitHub Advisory, allauth release notes). As a short-term workaround where upgrading is not immediately possible, restrict the ability of users and administrators to modify preferred_username values in your Okta or NetIQ identity provider configuration. Additionally, review your application's socialaccount_socialaccount table for any suspicious account associations that may have occurred prior to patching.

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-70646HIGH7.5
  • Python logoPython
  • aiosend
NoYesAug 06, 2026
CVE-2026-71554MEDIUM5.3
  • Python logoPython
  • python-h2
NoYesAug 06, 2026
CVE-2026-71433MEDIUM5.3
  • Python logoPython
  • langgraph-checkpoint-postgres
NoYesAug 06, 2026
CVE-2026-61632MEDIUM5.3
  • Python logoPython
  • pymdown-extensions
NoYesAug 06, 2026
CVE-2026-64640MEDIUM5.3
  • Python logoPython
  • polaris
NoYesAug 06, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management