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

Update dependency league/commonmark to ^2.6.0 [SECURITY] #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 10, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
league/commonmark (source) ^2.4.2 -> ^2.6.0 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

GitHub 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:

  • Setting very low memory_limit and max_execution_time PHP configurations to prevent runaway resource usage
  • Implementing rate-limiting, bot protection, or other approaches to reduce the risk of simultaneous bad requests hitting your site
  • Limiting the size of inputs fed into this library (specifically the max length of each line)
  • Limiting the use of this library to trusted users

References

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:


Release Notes

thephpleague/commonmark (league/commonmark)

v2.6.0

Compare 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
  • Added max_delimiters_per_line config option to prevent denial of service attacks when parsing malicious input
  • Added table/max_autocompleted_cells config option to prevent denial of service attacks when parsing large tables
  • The AttributesExtension now supports attributes without values (#​985, #​986)
  • The AutolinkExtension exposes two new configuration options to override the default behavior (#​969, #​987):
    • autolink/allowed_protocols - an array of protocols to allow autolinking for
    • autolink/default_protocol - the default protocol to use when none is specified
  • Added RegexHelper::isWhitespace() method to check if a given character is an ASCII whitespace character
  • Added CacheableDelimiterProcessorInterface to ensure linear complexity for dynamic delimiter processing
  • Added Bracket delimiter type to optimize bracket parsing
Changed
  • [ and ] are no longer added as Delimiter objects on the stack; a new Bracket type with its own stack is used instead
  • UrlAutolinkParser no longer parses URLs with more than 127 subdomains
  • Expanded reference links can no longer exceed 100kb, or the size of the input document (whichever is greater)
  • Delimiters should always provide a non-null value via DelimiterInterface::getIndex()
    • We'll attempt to infer the index based on surrounding delimiters where possible
  • The DelimiterStack now accepts integer positions for any $stackBottom argument
  • Several small performance optimizations

v2.5.3

Compare Source

Changed
  • Made compatible with CommonMark spec 0.31.1, including:
    • Remove source, add search to list of recognized block tags

v2.5.2

Compare Source

Changed
  • Boolean attributes now require an explicit true value (#​1040)
Fixed
  • Fixed regression where text could be misinterpreted as an attribute (#​1040)

v2.5.1

Compare Source

Fixed
  • Fixed attribute parsing incorrectly parsing mustache-like syntax (#​1035)
  • Fixed incorrect Table start line numbers (#​1037)

v2.5.0

Compare Source

Added
  • The AttributesExtension now supports attributes without values (#​985, #​986)
  • The AutolinkExtension exposes two new configuration options to override the default behavior (#​969, #​987):
    • autolink/allowed_protocols - an array of protocols to allow autolinking for
    • autolink/default_protocol - the default protocol to use when none is specified
Changed
  • Made compatible with CommonMark spec 0.31.0, including:
    • Allow closing fence to be followed by tabs
    • Remove restrictive limitation on inline comments
    • Unicode symbols now treated like punctuation (for purposes of flankingness)
    • Trailing tabs on the last line of indented code blocks will be excluded
    • Improved HTML comment matching
  • Paragraphs only containing link reference definitions will be kept in the AST until the Document is finalized
    • (These were previously removed immediately after parsing the Paragraph)
Fixed
  • Fixed list tightness not being determined properly in some edge cases
  • Fixed incorrect ending line numbers for several block types in various scenarios
  • Fixed lowercase inline HTML declarations not being accepted

v2.4.4

Compare Source

Fixed
  • Fixed SmartPunct extension changing already-formatted quotation marks (#​1030)

v2.4.3

Compare Source

Fixed
  • Fixed the Attributes extension not supporting CSS level 3 selectors (#​1013)
  • Fixed UrlAutolinkParser incorrectly parsing text containing www anywhere 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.


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

Read more information about the use of Renovate Bot within Laminas.

| datasource | package           | from  | to    |
| ---------- | ----------------- | ----- | ----- |
| packagist  | league/commonmark | 2.4.2 | 2.6.0 |


Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants