Update dependency league/commonmark to ^2.7.0 [SECURITY] #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.4.2->^2.7.0GitHub Vulnerability Alerts
GHSA-c2pc-g5qf-rfrf
Impact
Several polynomial time complexity issues in league/commonmark may lead to unbounded resource exhaustion and subsequent denial of service.
Malicious users could trigger that inefficient code with carefully crafted Markdown inputs that are specifically designed to ensure the worst-case performance is reached. Sending multiple such requests in parallel could tie up all available CPU resources and/or PHP-FPM processes, leading to denial of service for legitimate users.
Patches
These vulnerabilities have been patched in version 2.6.0. All users on older versions are highly encouraged to upgrade as soon as possible.
Workarounds
If you cannot upgrade, you may be able to mitigate the issues by:
memory_limitandmax_execution_timePHP configurations to prevent runaway resource usageReferences
Most of these issues were discovered in other Markdown parsers. You can read more about them here:
For general information about this type of issue:
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'andallow_unsafe_links: falseto 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:
Which results in the following HTML:
Which causes the JS to execute immediately on page load.
Patches
Version 2.7.0 contains three changes to prevent this XSS attack vector:
onare considered unsafe and blocked by defaulthrefandsrcattributes now respect the existingallow_unsafe_linksconfiguration optionWorkarounds
If upgrading is not feasible, please consider:
AttributesExtensionfor untrusted usersRelease Notes
thephpleague/commonmark (league/commonmark)
v2.7.0Compare Source
This is a security release to address a potential cross-site scripting (XSS) vulnerability when using the
AttributesExtensionwith untrusted user input.Added
attributes/allowconfig option to specify which attributes users are allowed to set on elements (default allows virtually all attributes)Changed
AttributesExtensionblocks all attributes starting withonunless explicitly allowed via theattributes/allowconfig optionallow_unsafe_linksoption is now respected by theAttributesExtensionwhen users specifyhrefandsrcattributesv2.6.2Compare Source
Fixed
v2.6.1Compare Source
Fixed
v2.6.0Compare Source
This is a security release to address potential denial of service attacks when parsing specially crafted,
malicious input from untrusted sources (like user input).
Added
max_delimiters_per_lineconfig option to prevent denial of service attacks when parsing malicious inputtable/max_autocompleted_cellsconfig option to prevent denial of service attacks when parsing large tablesAttributesExtensionnow supports attributes without values (#985, #986)AutolinkExtensionexposes two new configuration options to override the default behavior (#969, #987):autolink/allowed_protocols- an array of protocols to allow autolinking forautolink/default_protocol- the default protocol to use when none is specifiedRegexHelper::isWhitespace()method to check if a given character is an ASCII whitespace characterCacheableDelimiterProcessorInterfaceto ensure linear complexity for dynamic delimiter processingBracketdelimiter type to optimize bracket parsingChanged
[and]are no longer added asDelimiterobjects on the stack; a newBrackettype with its own stack is used insteadUrlAutolinkParserno longer parses URLs with more than 127 subdomainsDelimiterInterface::getIndex()DelimiterStacknow accepts integer positions for any$stackBottomargumentv2.5.3Compare Source
Changed
source, addsearchto list of recognized block tagsv2.5.2Compare Source
Changed
truevalue (#1040)Fixed
v2.5.1Compare Source
Fixed
Tablestart line numbers (#1037)v2.5.0Compare Source
Added
AttributesExtensionnow supports attributes without values (#985, #986)AutolinkExtensionexposes two new configuration options to override the default behavior (#969, #987):autolink/allowed_protocols- an array of protocols to allow autolinking forautolink/default_protocol- the default protocol to use when none is specifiedChanged
Paragraphs only containing link reference definitions will be kept in the AST until theDocumentis finalizedParagraph)Fixed
v2.4.4Compare Source
Fixed
v2.4.3Compare Source
Fixed
UrlAutolinkParserincorrectly parsing text containingwwwanywhere before an autolink (#1025)Configuration
📅 Schedule: Branch creation - "" in timezone UTC, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
Read more information about the use of Renovate Bot within Laminas.