amateur
amateur

Reputation: 44635

Insecure '^' jshint issue

I am getting this jshint error "Insecure '^'" from this line of javascript:

var test = content.replace(/d=([^&]*)/, 'd=test');

Anyone know how I can resolve this issue?

Upvotes: 5

Views: 1259

Answers (1)

alex
alex

Reputation: 490443

Check Tolerate . and [^...]. in /RegExp/.

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.

Source.

Upvotes: 3

Related Questions