Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency pymdown-extensions to v10 [security] - autoclosed #389

Closed

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 15, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
pymdown-extensions ==9.3 -> ==10.0 age adoption passing confidence
pymdown-extensions ==8.2 -> ==10.0 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2023-32309

Summary

Arbitrary file read when using include file syntax.

Details

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.

base = "docs"
path = "/etc/passwd"
filename = os.path.join(base,path) # Filename is now /etc/passwd

PoC

import markdown

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

print(html)

Impact

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.

Suggestion

Specified snippets should be restricted to the configured, specified base paths as a safe default. Allowing relative or absolute paths that escape the specified base paths would need to be behind a feature switch that must be opt-in and would be at the developer's own risk.


Release Notes

facelessuser/pymdown-extensions (pymdown-extensions)

v10.0

Compare Source

10.0
  • Break: Snippets: snippets will restrict snippets to ensure they are under the base_path preventing snippets
    relative to the base_path but not explicitly under it. restrict_base_path can be set to False for legacy
    behavior.

v9.11

Compare Source

9.11

  • NEW: Emoji: Update to new CDN and use Twemoji 14.1.2.
  • NEW: Snippets: Ignore nested snippet section syntax when including a section.

v9.10

Compare Source

9.10

  • NEW: Blocks: Add new experimental general purpose blocks that provide a framework for creating fenced block
    containers for specialized parsing. A number of extensions utilizing general purpose blocks are included and are meant
    to be an alternative to (and maybe one day replace): Admonitions, Details, Definition Lists, and Tabbed. Also adds a
    new HTML plugin for quick wrapping of content with arbitrary HTML elements.
  • NEW: Highlight: When enabling line spans and/or line anchors, if a code block has an ID associated with it, line
    ids will be generated using that code ID instead of the code block count.
  • NEW: Snippets: Expand section syntax to allow section names with - and _.
  • NEW: Snippets: When check_paths is enabled, and a specified section is not found, raise an error.
  • NEW: Snippets: Add new experimental feature dedent_sections that will de-indent (remove any common leading
    whitespace from every line in text) from that block of text.
  • NEW: MagicLink: Update GitLab links to match recent changes and to be more correct.
  • NEW: MagicLink: Relax required hash length when performing link shortening.

v9.9.2

Compare Source

9.9.2

  • FIX: Snippets syntax can break in XML comments as XML comments do not allow --. Relax Snippets syntax such that
    -8<- (single -) are allowed.

v9.9.1

Compare Source

9.9.1

  • FIX: Use a different CDN for Twemoji icons as MaxCDN is no longer available.

v9.9

Compare Source

9.9
  • ENHANCE: BetterEm: Further improvements to strong/emphasis handling:
    • Ensure that one or more consecutive * or _ surrounded by whitespace are not considered as a token.
  • ENHANCE: Caret: Apply recent BetterEm improvements to Caret:
    • Fix case where ^^ nested between ^ would be handled in an unexpected way.
    • Ensure that one or more consecutive ^ surrounded by whitespace are not considered as a token.
  • ENHANCE: Tilde: Apply recent BetterEm improvements to Tilde:
    • Fix case where ~~ nested between ~ would be handled in an unexpected way.
    • Ensure that one or more consecutive ~ surrounded by whitespace are not considered a token.
  • ENHANCE: Mark: Apply recent BetterEm improvements to Mark:
    • Ensure that one or more consecutive = surrounded by whitespace are not considered a token.

v9.8

Compare Source

9.8
  • NEW: Formally declare support for Python 3.11.
  • FIX: BetterEm: Fix case where ** nested between * would be handled in an unexpected way.

v9.7

Compare Source

9.7
  • NEW: Tabbed: Add new syntax to allow forcing a specific tab to be selected by default.
  • NEW: Snippets: Add a new option to pass arbitrary HTTP headers.
  • NEW: Snippets: Allow specifying sections in a snippet and including just the specified section.

v9.6

Compare Source

9.6
  • NEW: Highlight: Allow greater granularity of specifying where language guessing takes place via guess_lang
    option (e.g. block vs inline).
  • NEW: Tabbed: Add options for generating tab IDs from tab titles.
  • NEW: Snippets: Add support for specifying specific lines for Snippets.
  • NEW: Snippets: Commenting out files in block format no longer requires a space directly after ;.
  • NEW: Snippets: A new sane way to escape snippets is now available.

v9.5

Compare Source

9.5

  • NEW: InlineHilite: Custom inline code block formatters can now be forced to raise an exception by raising a
    InlineHiliteException.
  • NEW: Snippets: Add new options to handle importing snippets from URL.
  • NEW: Snippets: Snippets will only swallow missing file errors (unless check_paths is enabled), all other errors
    will be propagated up.
  • NEW: Snippets: When a file or URL is missing, raise SnippetMissingError instead of IOError.
  • FIX: Snippets: Small issues related to recursive inclusion of snippets.

v9.4

Compare Source

9.4

  • NEW: Highlight: Changes in order to support Pygments 2.12+. If using Pygments and a version less than 2.12 is
    installed, Highlight will raise an exception.

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/pypi-pymdown-extensions-vulnerability branch 2 times, most recently from 61ff23a to 9b5463f Compare June 18, 2023 16:41
@renovate renovate bot force-pushed the renovate/pypi-pymdown-extensions-vulnerability branch from 9b5463f to eee2192 Compare July 5, 2023 00:40
@renovate renovate bot force-pushed the renovate/pypi-pymdown-extensions-vulnerability branch from eee2192 to b2b8874 Compare September 29, 2023 21:43
@renovate renovate bot force-pushed the renovate/pypi-pymdown-extensions-vulnerability branch 2 times, most recently from b1a6c9b to b695da8 Compare March 10, 2024 22:44
@renovate renovate bot force-pushed the renovate/pypi-pymdown-extensions-vulnerability branch from b695da8 to 822f787 Compare May 10, 2024 15:52
@renovate renovate bot changed the title chore(deps): update dependency pymdown-extensions to v10 [security] chore(deps): update dependency pymdown-extensions to v10 [security] - autoclosed May 10, 2024
@renovate renovate bot closed this May 10, 2024
@renovate renovate bot deleted the renovate/pypi-pymdown-extensions-vulnerability branch May 10, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants