CVE-2023-35936

Source
https://nvd.nist.gov/vuln/detail/CVE-2023-35936
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-35936.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2023-35936
Aliases
Related
Published
2023-07-05T21:15:09Z
Modified
2024-09-18T03:24:20.051478Z
Severity
  • 5.0 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:L CVSS Calculator
Summary
[none]
Details

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.

References

Affected packages

Debian:13 / haskell-pandoc

Package

Name
haskell-pandoc
Purl
pkg:deb/debian/haskell-pandoc?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.0.1-2

Affected versions

3.*

3.0.1-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:11 / pandoc

Package

Name
pandoc
Purl
pkg:deb/debian/pandoc?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.9.2.1-1+deb11u1

Affected versions

2.*

2.9.2.1-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:12 / pandoc

Package

Name
pandoc
Purl
pkg:deb/debian/pandoc?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.17.1.1-2~deb12u1

Affected versions

2.*

2.17.1.1-1.1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / pandoc

Package

Name
pandoc
Purl
pkg:deb/debian/pandoc?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.17.1.1-2

Affected versions

2.*

2.17.1.1-1.1
2.17.1.1-2~deb12u1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Git / github.com/jgm/pandoc

Affected ranges

Type
GIT
Repo
https://github.com/jgm/pandoc
Events

Affected versions

0.*

0.16.1.2

1.*

1.12.2.2
1.12.2.3
1.13
1.13.0.1
1.13.1
1.13.2
1.14
1.14.0.1
1.14.0.2
1.14.0.3
1.14.0.4
1.14.1
1.15
1.15.0.1
1.15.0.2
1.15.0.3
1.15.0.4
1.15.0.5
1.15.0.6
1.15.1
1.15.1.1
1.15.2
1.15.2.1
1.16
1.16.0.1
1.16.0.2
1.17
1.17.0.1
1.17.0.2
1.17.0.3
1.17.02
1.17.1
1.17.2
1.18
1.19
1.19.1
1.19.2

2.*

2.0
2.0.0.1
2.0.1
2.0.1.1
2.0.2
2.0.3
2.0.4
2.0.5
2.0.6
2.1
2.1.1
2.1.2
2.1.3
2.10
2.10.1
2.11
2.11.0.1
2.11.0.3
2.11.0.4
2.11.1
2.11.1.1
2.11.2
2.11.3
2.11.3.1
2.11.3.2
2.11.4
2.12
2.13
2.14
2.14.0.1
2.14.0.2
2.14.0.3
2.14.1
2.14.2
2.15
2.16
2.16.1
2.16.2
2.17
2.17.0.1
2.17.1
2.17.1.1
2.18
2.19
2.19.1
2.19.2
2.2
2.2.1
2.2.2
2.2.2.1
2.2.3
2.2.3.1
2.2.3.2
2.3
2.3.1
2.4
2.5
2.6
2.7
2.7.1
2.7.2
2.7.3
2.8
2.8.0.1
2.8.1
2.9
2.9.1
2.9.1.1
2.9.2
2.9.2.1

3.*

3.0
3.0.1
3.1
3.1.1
3.1.2
3.1.3

Other

delete

pandoc-cli-0.*

pandoc-cli-0.1
pandoc-cli-0.1.1

pandoc-lua-engine-0.*

pandoc-lua-engine-0.1
pandoc-lua-engine-0.1.1
pandoc-lua-engine-0.2
pandoc-lua-engine-0.2.0.1

pandoc-server-0.*

pandoc-server-0.1