# CVE-2023-45813: Inefficient Regular Expression Complexity in TorBot

> An attacker can cause a Denial of Service in TorBot by submitting a specially crafted URL that triggers exponential complexity in a regular expression.

- **Severity:** Medium 4.6 (`CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Oct 2023
- **Updated:** 13 Sep 2024
- **Also known as:** GHSA-72qw-p7hh-m3ff, PYSEC-2026-1969

## What is CVE-2023-45813?

CVE-2023-45813 is a medium-severity denial of service vulnerability in DedSecInside TorBot, published on 18 Oct 2023. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Torbot is an open source tor network intelligence tool. In affected versions the `torbot.modules.validators.validate_link function` uses the python-validators URL validation regex. This particular regular expression has an exponential complexity which allows an attacker to cause an application crash using a well-crafted argument. An attacker can use a well-crafted URL argument to exploit the vulnerability in the regular expression and cause a Denial of Service on the system. The validators file has been removed in version 4.0.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity)

## Which versions are affected by CVE-2023-45813?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `torbot` | PyPI | All versions | 4.0.0 |
| `torbot` | PyPI | All versions | 4.0.0 |
| `torbot` | PyPI | All versions | 4.0.0 |

Products: Torbot Project Torbot, Validators Project Validators.

## How do I fix CVE-2023-45813?

Upgrade torbot to 4.0.0 or later.

## Is CVE-2023-45813 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-45813 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-45813 and fix it if it is affected.

What it is: CVE-2023-45813 is a medium-severity denial of service vulnerability in DedSecInside TorBot, published on 18 Oct 2023. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-45813 exists.

Affected packages and fixed versions:
- torbot (PyPI): affected all versions; fixed in 4.0.0
- torbot (PyPI): affected all versions; fixed in 4.0.0
- torbot (PyPI): affected all versions; fixed in 4.0.0

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

## Sources

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

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