# CVE-2022-2255: Incorrect header handling in mod-wsgi

> Attackers can spoof client IP addresses by injecting X-Client-IP headers, bypassing IP-based security controls in WSGI applications.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Aug 2022
- **Updated:** 3 Aug 2024
- **Also known as:** ALSA-2025:4791, AZL-10734, BIT-mod_wsgi-2022-2255, DEBIAN-CVE-2022-2255, DLA-3111-1, GHSA-7527-8855-9cf8, MGASA-2022-0289, OESA-2022-1827, PYSEC-2022-254, RHSA-2025:4791, RLSA-2025:4791, SUSE-SU-2022:4010-1, SUSE-SU-2022:4013-1, SUSE-SU-2022:4488-1, UBUNTU-CVE-2022-2255, USN-5551-1, openSUSE-SU-2024:12535-1

## What is CVE-2022-2255?

CVE-2022-2255 is a high-severity vulnerability in Debian Debian Linux, published on 25 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A vulnerability was found in mod_wsgi. The X-Client-IP header is not removed from a request from an untrusted proxy, allowing an attacker to pass the X-Client-IP header to the target WSGI application because the condition to remove it is missing.

Weakness: CWE-345 (Insufficient Verification of Data Authenticity), CWE-348 (Use of Less Trusted Source)

## Which versions are affected by CVE-2022-2255?

4 open source packages ship an affected version, including mod-wsgi and mod_wsgi. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mod-wsgi` | PyPI | All versions | 4.9.3 |
| `mod-wsgi` | PyPI | All versions | 4.9.3 |
| `mod-wsgi` | PyPI | All versions | 4.9.3 |
| `mod_wsgi` | Bitnami | All versions | 4.9.3 |
| `python39` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-PyMySQL` | AlmaLinux:8 | All versions | 0.10.1-2.module_el8.6.0+2780+a40f65e1 |
| `python39-cffi` | AlmaLinux:8 | All versions | 1.14.3-2.module_el8.6.0+2780+a40f65e1 |
| `python39-cffi` | AlmaLinux:8 | All versions | 1.14.3-2.module_el8.6.0+3248+c431e88c |
| `python39-chardet` | AlmaLinux:8 | All versions | 3.0.4-19.module_el8.6.0+2780+a40f65e1 |
| `python39-cryptography` | AlmaLinux:8 | All versions | 3.3.1-3.module_el8.10.0+3765+2f9a457d |
| `python39-devel` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-idle` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-idna` | AlmaLinux:8 | All versions | 2.10-4.module_el8.10.0+3849+a48d89aa |
| `python39-libs` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-lxml` | AlmaLinux:8 | All versions | 4.6.5-1.module_el8.6.0+2780+a40f65e1 |
| `python39-lxml` | AlmaLinux:8 | All versions | 4.6.5-1.module_el8.6.0+3248+c431e88c |
| `python39-mod_wsgi` | AlmaLinux:8 | All versions | 4.7.1-7.module_el8.10.0+3989+a618fe15.1 |
| `python39-numpy` | AlmaLinux:8 | All versions | 1.19.4-3.module_el8.6.0+2780+a40f65e1 |
| `python39-numpy` | AlmaLinux:8 | All versions | 1.19.4-3.module_el8.6.0+3248+c431e88c |
| `python39-numpy-doc` | AlmaLinux:8 | All versions | 1.19.4-3.module_el8.6.0+2780+a40f65e1 |
| `python39-numpy-f2py` | AlmaLinux:8 | All versions | 1.19.4-3.module_el8.6.0+2780+a40f65e1 |
| `python39-numpy-f2py` | AlmaLinux:8 | All versions | 1.19.4-3.module_el8.6.0+3248+c431e88c |
| `python39-pip` | AlmaLinux:8 | All versions | 20.2.4-9.module_el8.10.0+3765+2f9a457d |
| `python39-pip-wheel` | AlmaLinux:8 | All versions | 20.2.4-9.module_el8.10.0+3765+2f9a457d |
| `python39-ply` | AlmaLinux:8 | All versions | 3.11-10.module_el8.6.0+2780+a40f65e1 |
| `python39-psutil` | AlmaLinux:8 | All versions | 5.8.0-4.module_el8.6.0+2780+a40f65e1 |
| `python39-psutil` | AlmaLinux:8 | All versions | 5.8.0-4.module_el8.6.0+3248+c431e88c |
| `python39-psycopg2` | AlmaLinux:8 | All versions | 2.8.6-3.module_el8.10.0+3765+2f9a457d |
| `python39-psycopg2-doc` | AlmaLinux:8 | All versions | 2.8.6-3.module_el8.10.0+3765+2f9a457d |
| `python39-psycopg2-tests` | AlmaLinux:8 | All versions | 2.8.6-3.module_el8.10.0+3765+2f9a457d |
| `python39-pycparser` | AlmaLinux:8 | All versions | 2.20-3.module_el8.6.0+2780+a40f65e1 |
| `python39-pysocks` | AlmaLinux:8 | All versions | 1.7.1-4.module_el8.6.0+2780+a40f65e1 |
| `python39-pyyaml` | AlmaLinux:8 | All versions | 5.4.1-1.module_el8.6.0+2780+a40f65e1 |
| `python39-pyyaml` | AlmaLinux:8 | All versions | 5.4.1-1.module_el8.6.0+3248+c431e88c |
| `python39-requests` | AlmaLinux:8 | All versions | 2.25.0-3.module_el8.9.0+3634+fb2a896c |
| `python39-rpm-macros` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-scipy` | AlmaLinux:8 | All versions | 1.5.4-5.module_el8.9.0+3634+fb2a896c |
| `python39-setuptools` | AlmaLinux:8 | All versions | 50.3.2-6.module_el8.10.0+3885+d986a391 |
| `python39-setuptools-wheel` | AlmaLinux:8 | All versions | 50.3.2-6.module_el8.10.0+3885+d986a391 |
| `python39-six` | AlmaLinux:8 | All versions | 1.15.0-3.module_el8.6.0+2780+a40f65e1 |

Products: Debian Debian Linux, Modwsgi Mod Wsgi.

## How do I fix CVE-2022-2255?

Upgrade mod-wsgi to 4.9.3 or later.

## Is CVE-2022-2255 being exploited?

There is no known exploitation of CVE-2022-2255 in the wild and no public exploit code.

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-2255 and fix it if it is affected.

What it is: CVE-2022-2255 is a high-severity vulnerability in Debian Debian Linux, published on 25 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-2255 in the wild and no public exploit code.

Affected packages and fixed versions:
- mod-wsgi (PyPI): affected all versions; fixed in 4.9.3
- mod-wsgi (PyPI): affected all versions; fixed in 4.9.3
- mod-wsgi (PyPI): affected all versions; fixed in 4.9.3
- mod_wsgi (Bitnami): affected all versions; fixed in 4.9.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-2255/ (Markdown: https://insights.sbomify.com/CVE-2022-2255/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-2255
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-2255
- OSV: https://osv.dev/vulnerability/CVE-2022-2255

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