Skip to content

Commit e3c1b96

Browse files
Marcono1234smowton
authored andcommitted
Java: Fix incorrect annotation handling for SpringControllerRequestMappingGetMethod
1 parent 998aa95 commit e3c1b96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class SpringControllerRequestMappingGetMethod extends SpringControllerGetMethod
4747
.getType()
4848
.hasQualifiedName("org.springframework.web.bind.annotation", "RequestMapping") and
4949
(
50-
this.getAnAnnotation().getEnumConstantValue("method").getName() = "GET" or
51-
this.getAnAnnotation().getValue("method").(ArrayInit).getSize() = 0 //Java code example: @RequestMapping(value = "test")
50+
this.getAnAnnotation().getAnEnumConstantArrayValue("method").getName() = "GET" or
51+
not exists(this.getAnAnnotation().getAnArrayValue("method")) //Java code example: @RequestMapping(value = "test")
5252
) and
5353
not this.getAParamType().getName() = "MultipartFile"
5454
}

0 commit comments

Comments
 (0)