# CVE-2022-31799: Denial of service in bottle

> Attackers can cause a denial of service in the Bottle web framework by sending malformed requests that trigger unhandled errors during binding.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 May 2022
- **Updated:** 3 Aug 2024
- **Also known as:** DEBIAN-CVE-2022-31799, DLA-3048-1, DSA-5159-1, GHSA-xhp9-4947-rq78, MGASA-2022-0245, OESA-2022-1712, PYSEC-2022-227, SUSE-SU-2022:3103-1, UBUNTU-CVE-2022-31799, USN-5532-1, USN-5532-2

## What is CVE-2022-31799?

CVE-2022-31799 is a critical denial of service vulnerability in Debian Debian Linux, published on 29 May 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Bottle before 0.12.20 mishandles errors during early request binding.

Weakness: CWE-755 (Improper Handling of Exceptional Conditions)

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

3 open source packages ship an affected version, including bottle. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `bottle` | PyPI | All versions | 0.12.20 |
| `bottle` | PyPI | All versions | 0.12.20 |
| `bottle` | PyPI | All versions | 0.12.20 |
| `python-bottle` | SUSE:Enterprise Storage 6 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Enterprise Storage 7 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise High Performance Computing 15-LTSS | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Module for Desktop Applications 15 SP3 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Module for Desktop Applications 15 SP4 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Module for Python 2 15 SP3 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Server 15 SP2-BCL | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Server 15-LTSS | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Server for SAP Applications 15 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Manager Proxy 4.1 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Manager Retail Branch Server 4.1 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | SUSE:Manager Server 4.1 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | openSUSE:Leap 15.3 | All versions | 0.12.13-150000.3.6.1 |
| `python-bottle` | openSUSE:Leap 15.4 | All versions | 0.12.13-150000.3.6.1 |

Products: Bottlepy Bottle, Debian Debian Linux, Fedoraproject Fedora.

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

Upgrade bottle to 0.12.20 or later.

## Is CVE-2022-31799 being exploited?

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

## Other vulnerabilities in Debian Debian Linux

- [CVE-2020-28473](https://insights.sbomify.com/CVE-2020-28473/): Web Cache Poisoning (medium 6.8)
- [CVE-2014-3137](https://insights.sbomify.com/CVE-2014-3137/): Bottle does not properly limit content-types (medium 6.8)
- [CVE-2016-9964](https://insights.sbomify.com/CVE-2016-9964/): bottle.py vulnerable to CRLF Injection (medium 6.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2022-31799 is a critical denial of service vulnerability in Debian Debian Linux, published on 29 May 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-31799 in the wild and no public exploit code.

Affected packages and fixed versions:
- bottle (PyPI): affected all versions; fixed in 0.12.20
- bottle (PyPI): affected all versions; fixed in 0.12.20
- bottle (PyPI): affected all versions; fixed in 0.12.20

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-31799/ (Markdown: https://insights.sbomify.com/CVE-2022-31799/index.md)
```

## Sources

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

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