Arbitrary File Read Affecting pymdown-extensions package, versions [1.5,10.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.16% (53rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary File Read vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-PYMDOWNEXTENSIONS-5537103
  • published16 May 2023
  • disclosed16 May 2023
  • credititlabbet

Introduced: 16 May 2023

CVE-2023-32309  (opens in a new tab)
CWE-22  (opens in a new tab)

How to fix?

Upgrade pymdown-extensions to version 10.0 or higher.

Overview

pymdown-extensions is an Extension pack for Python Markdown.

Affected versions of this package are vulnerable to Arbitrary File Read due to improper sanitization of file syntax passed via the get_snippet_path function. when using the syntax --8<--"/etc/passwd" or --8<--"/proc/self/environ" the content of these files will be rendered in the generated documentation.

PoC

import markdown

payload = "--8<-- \"/etc/passwd\""
html = markdown.markdown(payload, extensions=['pymdownx.snippets'])

print(html)

References

CVSS Scores

version 3.1