Every CVE Search/ Get API key

CVE-2023-35936

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

6.0 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
High
Privileges needed
Low
User interaction
Required

What an attacker can affect

Confidentiality
None
Integrity
High
Availability
Low

Exploit likelihood

0.37%Up 0.3 points since Jul 6, 2023
90%50%10%1%

What each source reports

CVE List Score used 6.0

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

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.

Record
CVE-2023-35936
CVSS 3.1
6.0 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:L
Weakness
CWE-20
Updated
2026-11-02
EUVDEUVD-2023-39920 6.0

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.

Record
EUVD-2023-39920
CVSS 3.1
6.0 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:L
Updated
2026-11-03
NVD 6.1

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.

Record
CVE-2023-35936
CVSS 3.1
6.1 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:L
CVSS 3.1
5.0 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:L
Weakness
CWE-20
Updated
2026-11-02
OSV 6.1

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

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.

Record
CVE-2023-35936
CVSS 3.1
6.1 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:L
Weakness
CWE-20
Updated
2026-11-02
OSVDEBIAN-CVE-2023-35936 5.0

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.

Record
DEBIAN-CVE-2023-35936
CVSS 3.1
5.0 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:L
Updated
2026-11-02
OSVJLSEC-2026-499 5.0

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.

Record
JLSEC-2026-499
CVSS 3.1
5.0 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:L
Updated
2026-11-02
OSVUBUNTU-CVE-2023-35936 6.1

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.

Record
UBUNTU-CVE-2023-35936
CVSS 3.1
6.1 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:L
CVSS 3.1
5.0 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:L
Updated
2026-11-02
OSVHSEC-2023-0014 No score

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

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

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).

This vulnerability only affects systems that (a) pass untrusted user input to pandoc and (b) allow pandoc to be used to produce a PDF or with the --extract-media option.

The vulnerability is patched in pandoc 3.1.4.

Record
HSEC-2023-0014
Updated
2026-11-02
OSVopenSUSE-SU-2024:13056-1 No score

ghc-pandoc-3.1.3-2.1 on GA media

These are all security issues fixed in the ghc-pandoc-3.1.3-2.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:13056-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
haskell-pandoc
Debian:13
before 3.0.1-2
3.0.1-2
haskell-pandoc
Debian:14
before 3.0.1-2
3.0.1-2
pandoc
Debian:12
before 2.17.1.1-2~deb12u1, plus listed versions
2.17.1.1-1.1
2.17.1.1-2~deb12u1
pandoc
Debian:13
before 2.17.1.1-2
2.17.1.1-2
pandoc
Debian:14
before 2.17.1.1-2
2.17.1.1-2
pandoc
Debian:10
before 2.2.1-3+deb10u1, plus listed versions
2.2.1-3
2.2.1-3+deb10u1
pandoc
Hackage
1.13 up to 3.1.4, plus listed versions
1.13.0.11.13.11.13.21.13.2.11.14
Show 45 moreShow less
1.14.0.11.14.0.21.14.0.31.14.0.41.14.11.151.15.0.11.15.0.21.15.0.31.15.0.41.15.0.51.15.0.61.15.11.15.1.11.15.21.15.2.11.161.16.0.11.16.0.21.171.17.0.11.17.0.21.17.0.31.17.11.17.21.181.191.19.11.19.21.19.2.11.19.2.21.19.2.31.19.2.42.02.0.0.12.0.12.0.1.12.0.22.0.32.0.42.0.52.0.62.12.1.12.1.2
3.1.4
pandoc_jll
Julia
before 3.1.9+0
3.1.9+0
pandoc
Ubuntu:14.04:LTS
All versions, plus listed versions
1.11.1-2build21.11.1-41.11.1-51.12.2.1-11.12.2.1-1build11.12.2.1-1build2
None known
pandoc
Ubuntu:16.04:LTS
All versions, plus listed versions
1.13.2.1~dfsg-1build61.15.1.1~dfsg-21.15.1.1~dfsg-2build11.16.0.2~dfsg-1
None known
Show 7 moreShow less
Affected packages
PackageAffectedFixed
pandoc
Ubuntu:18.04:LTS
All versions, plus listed versions
1.19.2.1.0-11.19.2.4~dfsg-1build11.19.2.4~dfsg-1build21.19.2.4~dfsg-1build31.19.2.4~dfsg-1build4
None known
pandoc
Ubuntu:20.04:LTS
All versions, plus listed versions
2.5-22.5-32.5-3build12.5-3build2
None known
pandoc
Ubuntu:22.04:LTS
All versions, plus listed versions
2.9.2.1-1ubuntu42.9.2.1-3ubuntu12.9.2.1-3ubuntu2
None known
pandoc
Ubuntu:24.04:LTS
All versions, plus listed versions
2.17.1.1-3ubuntu13.0.1+ds-33.1.3+ds-13.1.3+ds-2
None known
pandoc
Ubuntu:25.10
All versions, plus listed versions
3.1.11.1+ds-23.1.11.1+ds-4
None known
pandoc
Ubuntu:26.10
All versions, plus listed versions
3.7.0.2+ds-13.9.0.2-13.10-13.11-1
None known
pandoc
Ubuntu:26.04:LTS
All versions, plus listed versions
3.1.11.1+ds-43.7.0.2+ds-1
None known

History

History
RecordedChangedSources
aliases, publishedEUVD
first indexedCVE List, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2023-35936 is a medium vulnerability (CVSS 6.0) in Jgm Pandoc, published July 5, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.37%, the 30th percentile. Fixed in haskell-pandoc 3.0.1-2.

References

Show 5 moreShow less
This page doesn't list everything

Left out here: 65 versions. The JSON record has them.

MoveEnter Open