Security Vulnerability Report
中文
CVE-2025-65431 CVSS 5.4 MEDIUM

CVE-2025-65431

Published: 2025-12-15 14:15:57
Last Modified: 2025-12-23 18:08:38

Description

An issue was discovered in allauth-django before 65.13.0. Both Okta and NetIQ were using preferred_username as the identifier for third-party provider accounts. That value may be mutable and should therefore be avoided for authorization decisions. The providers are now using sub instead.

CVSS Details

CVSS Score
5.4
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:allauth:allauth:*:*:*:*:*:django:*:* - VULNERABLE
django-allauth < 65.13.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-65431 PoC - django-allauth preferred_username Manipulation # This PoC demonstrates the identification bypass vulnerability import requests import json def exploit_cve_2025_65431(): """ Simulated PoC for CVE-2025-65431 Attack scenario: Manipulating preferred_username to hijack accounts """ print("=== CVE-2025-65431 Exploitation Simulation ===") print("Target: django-allauth < 65.13.0") print("Vulnerability: preferred_username used for authorization ") # Step 1: Attacker has legitimate Okta/NetIQ account attacker_id_token = { "sub": "attacker-unique-id-12345", "preferred_username": "[email protected]", "email": "[email protected]", "name": "Attacker User" } # Step 2: Attacker modifies preferred_username to victim's username # In real attack, this depends on Okta/NetIQ configuration modified_id_token = { "sub": "attacker-unique-id-12345", "preferred_username": "[email protected]", "email": "[email protected]", "name": "Attacker User" } # Step 3: System uses preferred_username for linking/authorization # Vulnerable code would link attacker to victim's account print("[VULNERABLE] preferred_username: [email protected]") print("[VULNERABLE] System links attacker to victim account") print("[VULNERABLE] Attacker gains unauthorized access to victim's resources ") # Step 4: After patch, system uses immutable 'sub' field print("[PATCHED] Using 'sub' field for user identification") print("[PATCHED] sub: attacker-unique-id-12345 (immutable)") print("[PATCHED] Attacker cannot impersonate victim") return True def check_vulnerable_version(): """ Check if django-allauth version is vulnerable """ # Vulnerable versions: < 65.13.0 vulnerable = True version = "65.12.0" if vulnerable: print(f"[VULN] Installed version: {version} (VULNERABLE)") print("[VULN] Recommendation: Upgrade to django-allauth >= 65.13.0") else: print(f"[SAFE] Installed version: {version} (PATCHED)") if __name__ == "__main__": exploit_cve_2025_65431() check_vulnerable_version()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-65431", "sourceIdentifier": "[email protected]", "published": "2025-12-15T14:15:57.133", "lastModified": "2025-12-23T18:08:38.100", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An issue was discovered in allauth-django before 65.13.0. Both Okta and NetIQ were using preferred_username as the identifier for third-party provider accounts. That value may be mutable and should therefore be avoided for authorization decisions. The providers are now using sub instead."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N", "baseScore": 5.4, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 2.5}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-287"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:allauth:allauth:*:*:*:*:*:django:*:*", "versionEndExcluding": "65.13.0", "matchCriteriaId": "64041413-AFF0-4ABD-9781-3F59ACEFE49C"}]}]}], "references": [{"url": "https://allauth.org/news/2025/10/django-allauth-65.13.0-released/", "source": "[email protected]", "tags": ["Release Notes"]}]}}