jslint detects my following code as not secure:
/([^\n]+)([\n\s]*)/g
Later I learned there is a lint option:
". and [^...] in /RegExp/"
which you can find over here
Why is it not secure?
jslint detects my following code as not secure:
/([^\n]+)([\n\s]*)/g
Later I learned there is a lint option:
". and [^...] in /RegExp/"
which you can find over here
Why is it not secure?
The problem is with the [^...] character you're allowing almost anything in your regex and jshint detects a security risk.
This is what jslint docs says about [^...]:
true if . and [^...] should be allowed in RegExp literals. They match more material than might be expected, allowing attackers to confuse applications. These forms should not be used when validating in secure applications.