CVE-2007-0404: Django Django Arbitrary Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-qc99-g3wm-hgxr
Published
Advisory Summary

CVE-2007-0404 is a HIGH django arbitrary code execution vulnerability (General Security Weakness) affecting Django libraries in the PyPI ecosystem. The issue involves django arbitrary code execution. Remediation is available by upgrading affected packages to version 1.0.

CVE-2007-0404 at a Glance

CVE Identifier CVE-2007-0404
GHSA Identifier GHSA-qc99-g3wm-hgxr
Severity HIGH
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-0404

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-0404, 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

`bin/compile-messages.py` in Django 0.95 does not quote argument strings before invoking the msgfmt program through the os.system function, which allows attackers to execute arbitrary commands via shell metacharacters in a (1) .po or (2) .mo file.

CVE-2007-0404 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-0404?
CVE-2007-0404 is a security vulnerability in Django involving Django Arbitrary Code Execution 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-0404?
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-0404?
CVE-2007-0404 is classified under General Security Weakness.
How can I check PyPI dependencies for CVE-2007-0404?
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-qc99-g3wm-hgxr",
  "modified" : "2025-04-09T14:34:39Z",
  "published" : "2022-05-01T17:44:04Z",
  "aliases" : [ "CVE-2007-0404" ],
  "summary" : "Django Arbitrary Code Execution",
  "details" : "`bin/compile-messages.py` in Django 0.95 does not quote argument strings before invoking the msgfmt program through the os.system function, which allows attackers to execute arbitrary commands via shell metacharacters in a (1) .po or (2) .mo file.",
  "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-0404"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/518d406e53"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/a132d411c6986418ee6c0edc331080aa792fee6e"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=407519"
  }, {
    "type" : "WEB",
    "url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/31627"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "http://code.djangoproject.com/changeset/3592"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-14T17:18:37Z",
    "nvd_published_at" : "2007-01-23T00:28:00Z"
  }
}