Skip to content

re2 as safer opt-in regexp engine replacement ? #28642

Closed

Description

@kapouer

Since v8 won't work around the exponential backtracking issue:
https://bugs.chromium.org/p/v8/issues/detail?id=6872
this would address
#9337
without imposing nor actually breaking anything.

I find it extremely bad - and a reason for people to criticize node - that developers can so easily make their applications vulnerable to that kind of DOS.

Also note that v8 authors are even blogging (and this is very interesting) about it (last week !):
https://medium.com/@erik_68861/regexp-backtracking-in-loops-and-how-we-can-optimize-it-away-ef3b2590f87e
so "just wait" might even be a solution...

Activity

  1. bnoordhuis commented on Jul 11, 2019

    @bnoordhuis
    Member

    I'd say you're in the wrong bug tracker and that you need to take this up with the V8 team.

    Irregexp is very tightly and deeply integrated with V8. Trying to replace it would be tantamount to maintaining a fork of V8 in perpetuity. We have a strong 'upstream first' policy so that's not going to fly.

  2. added
    feature request
    v8 engine
    on Jul 11, 2019
  3. mscdex commented on Jul 11, 2019

    @mscdex
    Contributor

    Also I didn't see evidence of the V8 team saying they won't fix this, but that it's a low priority currently. Of course if someone considered it a higher priority and they submitted a fix for the issue, I'm sure V8 would be open to that.

  4. bnoordhuis commented on Jul 14, 2019

    @bnoordhuis
    Member

    I'll go ahead and close this out as a wontfix.

  5. added
    wontfix
    on Jul 14, 2019
  6. kapouer commented on Mar 17, 2021

    @kapouer
    ContributorAuthor

    For the record:
    https://v8.dev/blog/non-backtracking-regexp
    so eventually this will be available with a "l"inear regexp flag.

  7. devsnek commented on Mar 17, 2021

    @devsnek
    Member

    It will be available without the l flag. the flag is a non-standard (and not exposed by default) option to make it throw if the non-backtracking engine can't be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestv8 enginewontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions