Is passing text directly from user to `java.util.regex.Pattern` safe? -




is passing user input directly java.util.regex.pattern later used java.util.regex.matcher safe?

if not, why? create infinite loop or exponential calculation? if so, other options?

regexp never safe. personally, refrain using them if don't have to. can construct regexp take ages checked or ever crash system.

some additional reading can found here: http://www.regular-expressions.info/catastrophic.html

i can't think of use-case justify letting user pass regex server.





wiki

Comments

Popular posts from this blog

elasticsearch - what is the equivalent data type for geo_point in hibernate search? -

firebase - How to wait value in Ionic 2 -

Jenkins: find build number for git commit -