{"id":"CVE-2023-32309","published":"2023-05-15T20:42:34Z","modified":"2025-01-22T21:41:46Z","title":"Arbitrary file inclusion with the pymdowm-snippets extension","vendor":"facelessuser","product":"pymdown-extensions","tier":"tail","description":{"text":"PyMdown Extensions is a set of extensions for the `Python-Markdown` markdown project. In affected versions an arbitrary file read is possible when using include file syntax. By using the syntax `--8<--\"/etc/passwd\"` or `--8<--\"/proc/self/environ\"` the content of these files will be rendered in the generated documentation. Additionally, a path relative to a specified, allowed base path can also be used to render the content of a file outside the specified base paths: `--8<-- \"../../../../etc/passwd\"`. Within the Snippets extension, there exists a `base_path` option but the implementation is vulnerable to Directory Traversal. The vulnerable section exists in `get_snippet_path(self, path)` lines 155 to 174 in snippets.py. Any readable file on the host where the plugin is executing may have its content exposed. This can impact any use of Snippets that exposes the use of Snippets to external users. It is never recommended to use Snippets to process user-facing, dynamic content. It is designed to process known content on the backend under the control of the host, but if someone were to accidentally enable it for user-facing content, undesired information could be exposed. This issue has been addressed in version 10.0. Users are advised to upgrade. Users unable to upgrade may restrict relative paths by filtering input.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01658,"percentile":0.7722,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/facelessuser/pymdown-extensions/security/advisories/GHSA-jh85-wwv9-24hv","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/facelessuser/pymdown-extensions/commit/b7bb4878d6017c03c8dc97c42d8d3bb6ee81db9d","tags":["x_refsource_MISC"]}],"priority":{"score":25.7,"factors":[{"name":"EPSS percentile","points":15.44},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.25}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2023-05-16","earliestUrl":"https://github.com/itlabbet/CVE-2023-32309","repos":[{"name":"itlabbet/CVE-2023-32309","url":"https://github.com/itlabbet/CVE-2023-32309","stars":0,"created":"2023-05-16"}]},"first":{"date":"2023-05-16","source":"PoC-in-GitHub","url":"https://github.com/itlabbet/CVE-2023-32309"},"provenance":"source"},"vendorSlug":"facelessuser","affectedVersions":[{"vendor":"facelessuser","product":"pymdown-extensions","versions":[">= 1.5, < 10.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2025-01-22T21:41:14.909644Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"pymdown-extensions","vulnerableRanges":[">=1.5, <10.0"],"patched":["10.0"],"from":["GHSA-jh85-wwv9-24hv","PYSEC-2026-1824"],"provenance":"source"}],"summary":{"text":"A path traversal flaw in the Snippets extension of pymdown-extensions (the get_snippet_path function in snippets.py, used with the --8<-- include syntax) lets the base_path restriction be bypassed through relative paths. An attacker who can get the Snippets extension to process attacker-supplied include content over the network, without authentication or user interaction, can read any file readable by the host process, such as /etc/passwd or /proc/self/environ, and have its contents rendered into the generated documentation.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T07:23:19Z"},"euvd":{"id":"EUVD-2023-1568","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-facelessuser-pymdown-extensions-cve-2023-32309","children":[{"from":"CVE-2023-32309","to":"CVE-2026-46338","relation":"regression","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"regression","quote":"This is a regression of CVE-2023-32309.","from":"CVE.org","in":"CVE-2026-46338"},{"kind":"same-code","provenance":"machine","files":["pymdownx/__meta__.py","pymdownx/snippets.py"],"commits":["https://github.com/facelessuser/pymdown-extensions/commit/b7bb4878d6017c03c8dc97c42d8d3bb6ee81db9d","https://github.com/facelessuser/pymdown-extensions/commit/63b7835776d703d6c339cf2110d9888f676efc0c"],"basis":"shared function","functions":["get_snippet_path","parse_version"]}]},{"from":"CVE-2023-32309","to":"CVE-2025-68142","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["pymdownx/__meta__.py"],"commits":["https://github.com/facelessuser/pymdown-extensions/commit/b7bb4878d6017c03c8dc97c42d8d3bb6ee81db9d","https://github.com/facelessuser/pymdown-extensions/commit/b50d15a56850ed1408a284bba81cc019c6bd72e8"],"basis":"shared function","functions":["parse_version"]}]},{"from":"CVE-2023-32309","to":"CVE-2026-67422","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["pymdownx/__meta__.py"],"commits":["https://github.com/facelessuser/pymdown-extensions/commit/b7bb4878d6017c03c8dc97c42d8d3bb6ee81db9d","https://github.com/facelessuser/pymdown-extensions/commit/c68498598d7b13011bb4571350b6e3612a4ce44b"],"basis":"shared function","functions":["parse_version"]}]}]}}