Skip to content
Heist/ feed
Back to feed
MediumFix available

haskell-pandoc, pandoc — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-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. 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.

Products
haskell-pandoc, pandoc
Affected versions
2.17.1.1-1.1
Fixed versions
2.17.1.1-2, 2.17.1.1-2~deb12u1, 3.0.1-2
CVEs
CVE-2023-35936
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 15:55 UTC · Revision 1

Source evidence

DEBIAN-CVE-2023-35936

core-osv · Original source

Published 5 Jul 2023, 21:15 UTC

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.

osv:DEBIAN-CVE-2023-35936

haskell-pandoc

Fixed versions: 3.0.1-2

haskell-pandoc

Fixed versions: 3.0.1-2

pandoc

Fixed versions: 2.17.1.1-2~deb12u1

pandoc

Fixed versions: 2.17.1.1-2

pandoc

Fixed versions: 2.17.1.1-2

Complete source record
{
  "id": "e7b29606faa7042818bb84fcf2031ad8eb7053d0dc25b08fa5bc7e71e353605e",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2023-35936",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2023-35936",
    "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.",
    "evidence": "osv:DEBIAN-CVE-2023-35936",
    "products": [
      {
        "name": {
          "value": "haskell-pandoc",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.0.1-2",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "haskell-pandoc",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.0.1-2",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "pandoc",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.17.1.1-2~deb12u1",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "2.17.1.1-1.1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "pandoc",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.17.1.1-2",
            "evidence": "/affected/3/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "pandoc",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.17.1.1-2",
            "evidence": "/affected/4/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "DEBIAN-CVE-2023-35936",
      "aliases": [
        "DEBIAN-CVE-2023-35936"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.0.1-2"
                }
              ]
            }
          ],
          "package": {
            "name": "haskell-pandoc",
            "purl": "pkg:deb/debian/haskell-pandoc?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-35936.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.0.1-2"
                }
              ]
            }
          ],
          "package": {
            "name": "haskell-pandoc",
            "purl": "pkg:deb/debian/haskell-pandoc?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-35936.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.17.1.1-2~deb12u1"
                }
              ]
            }
          ],
          "package": {
            "name": "pandoc",
            "purl": "pkg:deb/debian/pandoc?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "versions": [
            "2.17.1.1-1.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-35936.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.17.1.1-2"
                }
              ]
            }
          ],
          "package": {
            "name": "pandoc",
            "purl": "pkg:deb/debian/pandoc?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-35936.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.17.1.1-2"
                }
              ]
            }
          ],
          "package": {
            "name": "pandoc",
            "purl": "pkg:deb/debian/pandoc?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-35936.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-26T18:02:30.268903918Z",
      "provider": "osv",
      "upstream": [
        "CVE-2023-35936"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2023-35936"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2023-35936",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 456088,
  "published_at": "2023-07-05T21:15:09.627+00:00"
}