Skip to content

Update dependency league/commonmark to v2.7.0 [SECURITY]#69

Merged
mrgeneralgoo merged 1 commit intomasterfrom
renovate/packagist-league-commonmark-vulnerability
May 28, 2025
Merged

Update dependency league/commonmark to v2.7.0 [SECURITY]#69
mrgeneralgoo merged 1 commit intomasterfrom
renovate/packagist-league-commonmark-vulnerability

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented May 6, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
league/commonmark (source) 2.6.1 -> 2.7.0 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2025-46734

Summary

Cross-site scripting (XSS) vulnerability in the Attributes extension of the league/commonmark library (versions 1.5.0 through 2.6.x) allows remote attackers to insert malicious JavaScript calls into HTML.

Details

The league/commonmark library provides configuration options such as html_input: 'strip' and allow_unsafe_links: false to mitigate cross-site scripting (XSS) attacks by stripping raw HTML and disallowing unsafe links. However, when the Attributes Extension is enabled, it introduces a way for users to inject arbitrary HTML attributes into elements via Markdown syntax using curly braces.

As a result, even with the secure configuration shown above, an attacker can inject dangerous attributes into applications using this extension via a payload such as:

![](){onerror=alert(1)}

Which results in the following HTML:

<p><img onerror="alert(1)" src="" alt="" /></p>

Which causes the JS to execute immediately on page load.

Patches

Version 2.7.0 contains three changes to prevent this XSS attack vector:

Workarounds

If upgrading is not feasible, please consider:


Release Notes

thephpleague/commonmark (league/commonmark)

v2.7.0

Compare Source

This is a security release to address a potential cross-site scripting (XSS) vulnerability when using the AttributesExtension with untrusted user input.

Added
  • Added attributes/allow config option to specify which attributes users are allowed to set on elements (default allows virtually all attributes)
Changed
  • The AttributesExtension blocks all attributes starting with on unless explicitly allowed via the attributes/allow config option
  • The allow_unsafe_links option is now respected by the AttributesExtension when users specify href and src attributes

v2.6.2

Compare Source

Fixed
  • Fixed Attributes extension parsing regression (#​1071)

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 this update again.


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

This PR was generated by Mend Renovate. View the repository job log.

@mrgeneralgoo mrgeneralgoo merged commit 923202e into master May 28, 2025
4 of 5 checks passed
@renovate renovate bot deleted the renovate/packagist-league-commonmark-vulnerability branch May 28, 2025 11:30
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.

1 participant