Skip to content

Conversation

ericcornelissen
Copy link

Improve a regular expression that appears twice in the examples which could lead to quadratic runtime if the input is crafted to match /\{+/ plus some rejecting suffix. In these examples this is unlikely since the markdown files are probably trusted. This change is mostly focused towards anyone that starts from the examples and expands to cases where the markdown files may not be trusted (i.e., user-provided templates).

Technically this changes the behavior of these examples, because names can no longer contain a {, but given they're just examples this "breaking change" seems acceptable to me.

Improve a regular expression that appears twice in the examples
which could lead to quadratic runtime if the input is crafted to
match /\{+/ plus some rejecting suffix.

In these examples this is unlikely since the markdown files are
probably trusted. This change is mostly focussed towards anyone
that starts from the examples and expands to cases where the
markdown files may not be trusted (i.e., user-provided templates).

Technically this changes the behavior of these examples, because
names may no longer contain a '{', but given they're just examples
this "breaking change" seems acceptable to me.

Signed-off-by: Eric Cornelissen <ericornelissen@gmail.com>
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.

1 participant