Critical Vulnerabilities in php-dompdf: Security Risks and Mitigation

php-dompdf Updated 03 Oct 2025

Summary

10/08/2023
N/A
Yes i
Unrated
Not published

USN-6277-2: php-dompdf vulnerabilities. Affects php-dompdf versions < 0.6.2+dfsg-3.1ubuntu0.1. Fixed in 0.6.2+dfsg-3.1ubuntu0.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

php-dompdf is a popular PHP library that enables the generation of PDF documents from HTML content. It is widely used in web applications for creating dynamic reports and documents. However, vulnerabilities have been identified in this package, particularly in how it processes untrusted HTML input, which can lead to severe security risks.

Vulnerability Detail

The vulnerabilities in php-dompdf stem from improper validation of untrusted input when processing HTML content. Specifically, issues were discovered that could allow an attacker to expose sensitive information or execute arbitrary code. The vulnerabilities include the handling of PHAR file references and the bypassing of chroot checks, which can lead to deserialization of untrusted data and unauthorized access to local files.

How To Fix

Minimum fixed version

0.6.2+dfsg-3.1ubuntu0.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade php-dompdf

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, ensure that your application does not process untrusted HTML content or restrict the use of PHAR files until the package can be updated. Additionally, consider implementing input validation and sanitization measures in your application to mitigate risks.

Conclusion

In summary, the vulnerabilities in php-dompdf pose significant security risks that can lead to unauthorized access and code execution. It is crucial to update to the latest version to mitigate these risks and ensure the security of your applications.

See every vulnerability recorded for php-dompdf →

Share this vulnerability

FAQ

php-dompdf is a PHP library that converts HTML to PDF, allowing developers to generate PDF documents dynamically.

The main vulnerabilities include improper validation of untrusted HTML input, which can lead to arbitrary code execution and exposure of sensitive information.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If you cannot update the package, implement strict input validation and avoid processing untrusted HTML content as a temporary measure.

More information can be found in the original advisory details and the related CVEs, including CVE-2021-3838 and CVE-2022-2400.

Related vulnerabilities

Recent vulnerabilities recorded for php-dompdf.

How To Fix

Minimum fixed version

0.6.2+dfsg-3.1ubuntu0.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade php-dompdf

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback