Arbitrary File Write Vulnerability in Pandoc: A Critical Security Flaw

haskell-pandoc Updated 02 Oct 2025

Summary

05/07/2023
N/A
Yes i
Medium
5.0

CVE-2023-35936: Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library. Affects haskell-pandoc across 2 version ranges.

< 3.0.1-2 >= a004216706ef741919f817825843c3d531ff05f3, < 726822fc3247059530579cd6bb3303edf98217dc

Fixed in 3.0.1-2. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Pandoc is a versatile Haskell library and command-line tool designed for converting between various markup formats. It is widely used for generating documents in formats such as PDF and HTML. The tool's functionality includes the ability to extract media from documents, making it a popular choice among developers and writers. However, a significant security vulnerability has been identified that allows for arbitrary file writes, posing a risk to systems that handle untrusted user input.

Vulnerability Detail

The vulnerability, identified as CVE-2023-35936, exists in Pandoc versions starting from 1.13 and prior to 3.1.4. It can be exploited by providing a specially crafted image element when generating files using the '--extract-media' option or when outputting to PDF format. This flaw enables an attacker to create or overwrite arbitrary files on the system, depending on the privileges of the process running Pandoc. The vulnerability arises from improper handling of percent-encoded paths, which can lead to unauthorized file access and manipulation.

How To Fix

Minimum fixed version

3.0.1-2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade haskell-pandoc

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

Workaround

As a temporary measure, you can audit the Pandoc command usage and disallow PDF output and the '--extract-media' option to mitigate the risk of exploitation. This can be done by modifying user permissions or creating a wrapper script that restricts these functionalities.

Conclusion

CVE-2023-35936 represents a significant security risk for users of Pandoc, particularly those who handle untrusted input. It is crucial to update to the latest version to mitigate this vulnerability and protect your systems from potential exploitation. Additionally, utilizing tools like Vulert can help monitor and alert for open-source vulnerabilities in your software.

See every vulnerability recorded for haskell-pandoc →

Share this vulnerability

FAQ

CVE-2023-35936 is a vulnerability in Pandoc that allows for arbitrary file writes due to improper handling of percent-encoded paths.

Pandoc versions starting from 1.13 and prior to 3.1.4 are affected by this vulnerability.

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

If an immediate update is not possible, consider auditing your Pandoc command usage and disallowing PDF output and the '--extract-media' option as a temporary workaround.

The CVSS score of CVE-2023-35936 is 5.0, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for haskell-pandoc.

How To Fix

Minimum fixed version

3.0.1-2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade haskell-pandoc

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