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

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -