CVE-2022-28368: Dompdf/dompdf Remote Code Injection Vulnerability
CRITICALCVE-2022-28368 is a CRITICAL (CVSS 9.8) remote code injection vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Dompdf/dompdf libraries in the Packagist ecosystem. The issue involves remote code injection in dompdf/dompdf. Remediation is available by upgrading affected packages to version 1.2.1.
CVE-2022-28368 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-28368
To remediate this vulnerability, upgrade all affected Dompdf/dompdf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade dompdf/dompdf to 1.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for dompdf/dompdf
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-28368, inspect your project dependencies for Dompdf/dompdf:
inspect dependencies for dompdf/dompdf
Analyze the terminal output to locate any version of Dompdf/dompdf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Dompdf/dompdf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-28368 Affected Dompdf/dompdf Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
dompdf/dompdf
|
Packagist |
< 1.2.1
|
1.2.1
|
References
Frequently Asked Questions
What is CVE-2022-28368?
Which Dompdf/dompdf versions are affected?
What version fixes CVE-2022-28368?
Is dompdf/dompdf affected?
What is the CVSS score of CVE-2022-28368?
What CWE is associated with CVE-2022-28368?
How can I check Packagist dependencies for CVE-2022-28368?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x752-qjv4-c4hc",
"modified" : "2022-04-15T16:49:27Z",
"published" : "2022-04-04T00:00:55Z",
"aliases" : [ "CVE-2022-28368" ],
"summary" : "Remote code injection in dompdf/dompdf",
"details" : "Dompdf is an HTML to PDF converter. Dompdf before 1.2.1 allows remote code execution via a .php file in the src:url field of an @font-face Cascading Style Sheets (CSS) statement (within an HTML input file).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "dompdf/dompdf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-28368"
}, {
"type" : "WEB",
"url" : "https://github.com/dompdf/dompdf/issues/2598"
}, {
"type" : "WEB",
"url" : "https://github.com/dompdf/dompdf/pull/2808"
}, {
"type" : "WEB",
"url" : "https://github.com/dompdf/dompdf/commit/4c70e1025bcd9b7694b95dd552499bd83cd6141d"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/dompdf/dompdf/CVE-2022-28368.yaml"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-x752-qjv4-c4hc"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/dompdf/dompdf"
}, {
"type" : "WEB",
"url" : "https://github.com/snyk-labs/php-goof"
}, {
"type" : "WEB",
"url" : "https://packagist.org/packages/dompdf/dompdf#v1.2.1"
}, {
"type" : "WEB",
"url" : "https://snyk.io/blog/security-alert-php-pdf-library-dompdf-rce"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.com/files/171738/Dompdf-1.2.1-Remote-Code-Execution.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-04-05T18:00:16Z",
"nvd_published_at" : "2022-04-03T03:15:00Z"
}
}