Hi Tim, Glad I’m not completely out to lunch
😊 >
"still not advisable to run arbitrary user-provided regular expressions on your hardware" I think my point here is that regexps are code, and if you allow users to upload code and then you run it, well, then you should be prepared for the consequences
😊 I have never written a regexp library, so my “suggested fix” should be taken with a huge grain of salt. Maybe a paragraph like this would be enough: “Note that even with the reduced scope of I-Regexp syntax, it is still possible to construct “evil regexps” that will cause parsing time and memory usage to grow
exponentially with the length of worst-case maliciously-crafted input strings. Cases where applications will evaluate regexps from untrusted sources should be avoided where possible, and implementors are encouraged to check the documentation of their underlying
regexp library to see if there are configurable mitigations, such as recursion depth limits, or time / memory use limits.” If you put any sort of paragraph to that effect, then I’ll be happy. --- Mike Ounsworth From: Tim Bray <tbray@xxxxxxxxxxxxxx> WARNING: This email originated outside of Entrust. I was reading your note and agreeing that yes, it remains possible to devise regexps that are going to cause combinatorial nasties in almost any conceivable implementation, but unconvinced about the conclusion
that it is "still not advisable to run arbitrary user-provided regular expressions on your hardware", because it seems to me that the only way to find out if the regexp is evil is to run it. But I think your closing paragraph provides a solution. On Mon, May 15, 2023 at 8:17 AM Mike Ounsworth via Datatracker <noreply@xxxxxxxx> wrote: …
That sounds like a good direction, but pretty complex. A simpler option would be that implementations impose a limit on time and/or memory costs and error out when those are breached. Do you think that a recommendation
along those lines would address your concerns? |
-- last-call mailing list last-call@xxxxxxxx https://www.ietf.org/mailman/listinfo/last-call