Skip to content

fix: fix quadratic execution in em mask - #2818

Merged
UziTech merged 2 commits into
markedjs:masterfrom
UziTech:fix-em
May 26, 2023
Merged

UziTech merged 2 commits into
markedjs:masterfrom
UziTech:fix-em

Conversation

@UziTech

@UziTech UziTech commented May 25, 2023

Copy link
Copy Markdown
Member

Marked version: v5.0.2

Description

Fix quadratic execution in em mask regexp

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

@vercel

vercel Bot commented May 25, 2023 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2023 0:23am

@joshbruce

Copy link
Copy Markdown
Member

Nice!

@calculuschild calculuschild left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow how did you notice this?

@joshbruce

Copy link
Copy Markdown
Member

@calculuschild: This was one of the first things I learned about when joining Marked on its adventure. Sometimes folks discover vulnerabilities, let the maintainers know, then the maintainers fix the issue.

This is how we met @davisjam in fact. (Mainly because I didn't handle it well - see comment history from a few years ago...I learned a lot about OSS in a very short time.)

In this case someone from Snyk sent notification in accordance with the security notice: https://github.com/markedjs/marked/blob/master/SECURITY.md

@UziTech being the awesome human he is, responded in a timely fashion with proposed solution. Snyk offered feedback to improve. And here we are. Hope that helps (and is an accurate representation).

@UziTech
UziTech merged commit a37fe8e into markedjs:master May 26, 2023
github-actions Bot pushed a commit that referenced this pull request May 26, 2023
## [5.0.3](v5.0.2...v5.0.3) (2023-05-26)

### Bug Fixes

* fix quadratic execution in em mask ([#2818](#2818)) ([a37fe8e](a37fe8e))
@UziTech
UziTech deleted the fix-em branch August 26, 2023 03:23
Logiclayer1111 pushed a commit to Logiclayer1111/marked that referenced this pull request Apr 20, 2026
## [5.0.3](markedjs/marked@v5.0.2...v5.0.3) (2023-05-26)

### Bug Fixes

* fix quadratic execution in em mask ([#2818](markedjs/marked#2818)) ([8e83aa2](markedjs/marked@8e83aa2))
felixonmars added a commit to felixonmars/archriscv-packages that referenced this pull request Nov 14, 2026
Raise the synchronous spec timing limit from one to ten seconds. On magmar,
quadratic_em_mask[0]/[2] and quadratic_emstrong_delim[0] pass their output
assertions but fail with "took too long" at 1.289s, 1.457s, and 2.386s.
Keep the full npm suite and a finite performance limit.

No applicable upstream timing fix was found; v18.0.3 already contains the
original fixes for these ReDoS regression cases.

https://github.com/markedjs/testutils/blob/0b48e035add614e1aac285baed2cbefbf1bebf80/src/run-tests.ts
markedjs/marked#2818
markedjs/marked#3906
https://archriscv.felixc.at/.status/logs/marked/marked-18.0.3-1.log

This branch was successfully deployed

1 active deployment
Preview — 48f64d4a Deployed May 26, 2023 by vercel[bot]
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.

4 participants