relax detection regex (#757)
Allow for content before and after the script; Allow optional semicolon
This commit is contained in:
parent
cd3fb8040f
commit
208aa42fdb
@ -45,7 +45,7 @@ public class CrossSiteScriptingLesson5a extends AssignmentEndpoint {
|
|||||||
@RequestParam Integer QTY4, @RequestParam String field1,
|
@RequestParam Integer QTY4, @RequestParam String field1,
|
||||||
@RequestParam String field2) {
|
@RequestParam String field2) {
|
||||||
|
|
||||||
if (field2.toLowerCase().matches("<script>.*(console\\.log\\(.*\\)|alert\\(.*\\))<\\/script>")) {
|
if (field2.toLowerCase().matches(".*<script>.*(console\\.log\\(.*\\)|alert\\(.*\\));?<\\/script>.*")) {
|
||||||
return failed(this).feedback("xss-reflected-5a-failed-wrong-field").build();
|
return failed(this).feedback("xss-reflected-5a-failed-wrong-field").build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user