CVE-2007-0405: Django Django Improper Access Control Vulnerability

MODERATE
Advisory Identifier: GHSA-mwv2-398h-v489
Published
Advisory Summary

CVE-2007-0405 is a MODERATE django improper access control vulnerability (General Security Weakness) affecting Django libraries in the PyPI ecosystem. The issue involves django improper access control. Remediation is available by upgrading affected packages to version 1.0.

CVE-2007-0405 at a Glance

CVE Identifier CVE-2007-0405
GHSA Identifier GHSA-mwv2-398h-v489
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Django
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2007-0405

To remediate this vulnerability, upgrade all affected Django dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Django fixed: 1.0
pip install Django>=1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show Django

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2007-0405, inspect your installed packages using pip:

pip show Django

Analyze the terminal output to locate any version of Django in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0), your application is affected.

Note: The pip show Django command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Django, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The LazyUser class in the AuthenticationMiddleware for Django 0.95 does not properly cache the user name across requests, which allows remote authenticated users to gain the privileges of a different user.

CVE-2007-0405 Affected Django Versions

1 component(s)
Fixed Versions:
1.0
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
≥ 0.95
< 1.0
All 1 versions
0.95
1.0

References

Frequently Asked Questions

What is CVE-2007-0405?
CVE-2007-0405 is a security vulnerability in Django involving Django Improper Access Control under General Security Weakness.
Which Django versions are affected?
Affected versions include releases prior to 1.0 across affected packages: Django.
What version fixes CVE-2007-0405?
Upgrading to 1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Django affected?
Yes, Django is affected in releases prior to 1.0. Upgrade your dependency to 1.0 or later.
What CWE is associated with CVE-2007-0405?
CVE-2007-0405 is classified under General Security Weakness.
How can I check PyPI dependencies for CVE-2007-0405?
Run the dependency tree command: 'pip show Django'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mwv2-398h-v489",
  "modified" : "2025-04-09T14:34:50Z",
  "published" : "2022-05-01T17:44:04Z",
  "aliases" : [ "CVE-2007-0405" ],
  "summary" : "Django Improper Access Control",
  "details" : "The LazyUser class in the AuthenticationMiddleware for Django 0.95 does not properly cache the user name across requests, which allows remote authenticated users to gain the privileges of a different user.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.95"
      }, {
        "fixed" : "1.0"
      } ]
    } ],
    "versions" : [ "0.95" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2007-0405"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/3c5782287e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/e89f0a65581f82a5740bfe989136cea75d09cd67"
  }, {
    "type" : "WEB",
    "url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/31628"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "http://code.djangoproject.com/changeset/3754"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-14T17:18:53Z",
    "nvd_published_at" : "2007-01-23T00:28:00Z"
  }
}