security: fix unsafe heading regex by davisjam · Pull Request #1224 · markedjs/marked · GitHub
Skip to content

security: fix unsafe heading regex - #1224

Merged
styfle merged 1 commit into
markedjs:masterfrom
davisjam:SonatypeReport
Apr 16, 2018
Merged

styfle merged 1 commit into
markedjs:masterfrom
davisjam:SonatypeReport

Conversation

@davisjam

@davisjam davisjam commented Apr 16, 2018 •

Copy link
Copy Markdown
Contributor

Problem:
REDOS could be triggered through exploitation of the 'heading' regex.

Solution:
Refactor regex. It matches the same language as before but
is less vulnerable to REDOS.
It is now safe using the bounds suggested by those disclosing it.
It remains super-linear but a successful exploit requires
a much longer attack string.

Fixes:
Issue disclosed privately.

Credit:
This issue was pointed out by
Nick Starke (@nstarke) and Adam Cazzolla (@atcazzual) of Sonatype Security research.

Problem:
REDOS could be triggered through exploitation of the 'heading' regex.

Solution:
Refactor regex. It matches the same language as before but
is less vulnerable to REDOS.
It is now safe using the bounds suggested by those disclosing it.
It remains super-linear but a successful exploit requires
a much longer attack string.

Fixes:
Issue disclosed privately.

Credit:
This issue was pointed out by
Nick Starke and Adam Cazzolla of Sonatype Security research.
@styfle
styfle merged commit 09afabf into markedjs:master Apr 16, 2018
@styfle

styfle commented Apr 16, 2018

Copy link
Copy Markdown
Member

zhenalexfan pushed a commit to zhenalexfan/MarkdownHan that referenced this pull request Nov 8, 2021
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.

3 participants