Skip to content
Fencer Vulns
medium 6.1

CVE-2023-35936 json

Arbitrary file write is possible in Pandoc when using PDF output or --extract-media with untrusted input

published 2023-07-05 3 y ago modified 2026-07-18 3 mo ago also EUVD-2023-39920 , GHSA-xj5q-fv23-575g , HSEC-2023-0014 , JLSEC-2026-499

cvss
6.1
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.4%
EPSS 0.4% chance of exploitation in 30 days, percentile 30%
public exploits
0
none known

Summary

Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library. Starting in version 1.13 and prior to version 3.1.4, Pandoc is susceptible to an arbitrary file write vulnerability, which can be triggered by providing a specially crafted image element in the input when generating files using the `--extract-media` option or outputting to PDF format. This vulnerability allows an attacker to create or overwrite arbitrary files on the system ,depending on the privileges of the process running pandoc. It only affects systems that pass untrusted user input to pandoc and allow pandoc to be used to produce a PDF or with the `--extract-media` option.

The fix is to unescape the percent-encoding prior to checking that the resource is not above the working directory, and prior to extracting the extension. Some code for checking that the path is below the working directory was flawed in a similar way and has also been fixed. Note that the `--sandbox` option, which only affects IO done by readers and writers themselves, does not block this vulnerability. The vulnerability is patched in pandoc 3.1.4. As a workaround, audit the pandoc command and disallow PDF output and the `--extract-media` option.

Patch / fix

  • hackage pandoc 3.1.4
  • julia pandoc_jll 3.1.9+0
  • pandoc pandoc 3.1.4
  • pandoc Debian 12 2.17.1.1-2~deb12u1
  • pandoc Debian 14, Debian 13 2.17.1.1-2
  • haskell-pandoc Debian 14, Debian 13 3.0.1-2

debian advisories DEBIAN-CVE-2023-35936

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2023-35936 updated cvss 5.0

pandoc: allows attacker to create or overwrite arbitrary files on the system

  • Red Hat Enterprise Linux 8 pandoc, pandoc-common
    affected: no fix planned “Will not fix”

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

0.37% chance of exploitation in the next 30 days, higher than 30% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/jgm/pandoc/security/advisories/GHSA-xj5q-fv23-575g referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 6.0 CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:L
NVD 3.1 5.0 CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:L
OSV 3.1 6.1 CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:L
OSV 3.1 5.0 CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:L

Affected packages

ecosystem package affected fixed in
hackage pandoc
>=1.13, <3.1.4
3.1.4
julia pandoc_jll
<3.1.9+0
3.1.9+0

Affected products

  • jgm pandoc

Classification

Weakness
  • CWE-20 Improper Input Validation

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.