# CVE-2023-33733: Reportlab vulnerable to remote code execution

> Attackers can execute arbitrary code by providing a crafted PDF file to applications using the Reportlab library.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 5 Jun 2023
- **Updated:** 8 Jan 2025
- **Also known as:** DEBIAN-CVE-2023-33733, DLA-3917-1, DSA-5791-1, GHSA-9q9m-c65c-37pq, OESA-2023-1456, PYSEC-2026-1871, SUSE-SU-2023:2561-1, SUSE-SU-2023:2688-1, UBUNTU-CVE-2023-33733, USN-6196-1

## What is CVE-2023-33733?

CVE-2023-33733 is a high-severity code injection vulnerability in n/a, published on 5 Jun 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

Reportlab up to v3.6.12 allows attackers to execute arbitrary code via supplying a crafted PDF file.

Weakness: CWE-94 (Improper Control of Generation of Code)

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

3 open source packages ship an affected version, including reportlab. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `reportlab` | PyPI | All versions | 3.6.13 |
| `reportlab` | PyPI | All versions | 3.6.13 |
| `reportlab` | PyPI | All versions | 3.6.13 |
| `python-reportlab` | SUSE:Linux Enterprise Module for Package Hub 15 SP4 | All versions | 3.4.0-150000.3.9.1 |
| `python-reportlab` | SUSE:Linux Enterprise Module for Package Hub 15 SP5 | All versions | 3.4.0-150000.3.9.1 |
| `python-reportlab` | SUSE:Linux Enterprise Workstation Extension 12 SP5 | All versions | 2.7-3.13.1 |
| `python-reportlab` | openSUSE:Leap 15.4 | All versions | 3.4.0-150000.3.9.1 |
| `python-reportlab` | openSUSE:Leap 15.5 | All versions | 3.4.0-150000.3.9.1 |

Products: Reportlab Reportlab.

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

Upgrade reportlab to 3.6.13 or later.

## Is CVE-2023-33733 being exploited?

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

Public exploit code:

- CVE-2023-33733 reportlab RCE (github_poc): https://github.com/c53elyas/CVE-2023-33733
- https://github.com/L41KAA/CVE-2023-33733-Exploit-PoC (github_poc): https://github.com/L41KAA/CVE-2023-33733-Exploit-PoC
- This lab was set up to test CVE-2023-33733 (github_poc): https://github.com/onion2203/Lab_Reportlab
- This project aims at re-analyzing and PoC about CVE-2023-33733. Reportlab up to v3.6.12 allows attackers to execute arbitrary code via supplying a crafted PDF file.  (github_poc): https://github.com/buiduchoang24/CVE-2023-33733
- Reportlab Library - Remote Code Execution (github_poc): https://github.com/hoangbui24/CVE-2023-33733

## Other vulnerabilities in n/a

- [CVE-2019-17626](https://insights.sbomify.com/CVE-2019-17626/): XML Injection in ReportLab (critical 9.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2023-33733 is a high-severity code injection vulnerability in n/a, published on 5 Jun 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-33733 exists.

Affected packages and fixed versions:
- reportlab (PyPI): affected all versions; fixed in 3.6.13
- reportlab (PyPI): affected all versions; fixed in 3.6.13
- reportlab (PyPI): affected all versions; fixed in 3.6.13

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

## Sources

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

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