Skip to content

Commit

Permalink
Limit () nesting inside urls
Browse files Browse the repository at this point in the history
Allow no more than 32 levels of nesting in `[]( (((((....))))) )`
for performance reasons.
  • Loading branch information
rlidwka committed Nov 19, 2020
1 parent ce8bc42 commit dda9c09
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/helpers/parse_link_destination.js
Expand Up @@ -59,6 +59,7 @@ module.exports = function parseLinkDestination(str, pos, max) {

if (code === 0x28 /* ( */) {
level++;
if (level > 32) { return result; }
}

if (code === 0x29 /* ) */) {
Expand Down

0 comments on commit dda9c09

Please sign in to comment.