# MAL-2026-6230: Malicious code in django-auth-middleware-plus (PyPI)


- **Type:** Malicious package
- **Package:** `django-auth-middleware-plus` (PyPI)
- **Published:** 19 Jun 2026

## What is MAL-2026-6230?

MAL-2026-6230 is a malicious package in django-auth-middleware-plus, published on 19 Jun 2026. 

### Official description

On import, django_auth_middleware_plus/__init__.py spawns a daemon thread that POSTs a JSON payload containing the host's hostname, username, cwd, environment variables matching key/secret/token/pass/auth/api, and the contents of ~/.env, ~/.bashrc, ~/.config,.env, and../.env to a hardcoded plaintext HTTP endpoint at http://4.210.177.128:8080/callback. The same import path reads ~/.pypirc and ~/.netrc (up to 200 bytes each) and ships them in the same payload, leaking the installer's PyPI publishing token and machine credentials to the attacker. A _persistence() routine appends an alias overriding `django` to `pip install django-auth-middleware-plus --upgrade` into ~/.bashrc, ~/.zshrc, and ~/.profile so subsequent shell sessions re-fetch and re-trigger the C2 callback. The package's METADATA falsely claims Home-page https://www.djangoproject.com/ and Author-email security@djangoproject.com to impersonate the Django Project — the package name and metadata are a typosquat lure for the genuine Django ecosystem.

During import, package exfiltrates sensitive enviromental variables, configuration files and establishes persistence via entry in `.bashrc` and similar files.

---

Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers.

Campaign: 2026-06-django-auth-middleware-plus

Reasons (based on the campaign):

 - dependency-confusion

 - exfiltration-credentials

 - exfiltration-env-variables

 - persistence

 - files-exfiltration

## What should I do about MAL-2026-6230?

Remove the package from your dependencies and lockfiles, then rotate any secrets on machines where it was installed.

## Fix prompt for AI coding agents

```text
MAL-2026-6230 is a malicious package: django-auth-middleware-plus (PyPI). Every version was published to cause harm.

Task:
1. Search this repository's dependency manifests and lockfiles for the package, including transitive dependencies.
2. If it is present, remove it, regenerate the lockfile with the project's package manager, and replace whatever it was used for.
3. List any CI runners, developer machines or containers that installed it, so their secrets can be rotated.
4. If the package is not used anywhere, say so and change nothing.

Reference: https://insights.sbomify.com/MAL-2026-6230/ (Markdown: https://insights.sbomify.com/MAL-2026-6230/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/MAL-2026-6230

---
From sbomify Insights: https://insights.sbomify.com/MAL-2026-6230/
Summaries are generated and may contain mistakes; the official description above is the record.
