Skip to content

Commit 8a3b7d8

Browse files
committed
Added rules file for OWASP's benchmark 13
1 parent 7e03522 commit 8a3b7d8

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"namespace": "diffblue",
3+
"rules":
4+
[
5+
{
6+
"comment": "Headers returned from ServletRequest can be tainted.",
7+
"class": "javax.servlet.http.HttpServletRequest",
8+
"method": "getHeaders:(Ljava/lang/String;)Ljava/util/Enumeration;",
9+
"result": {
10+
"location": "returns",
11+
"taint": "java.util.Enumeration<String>"
12+
}
13+
},
14+
{
15+
"comment": "Enumerating header strings yields tainted strings.",
16+
"class": "java.util.Enumeration",
17+
"method": "nextElement:()Ljava/lang/Object;",
18+
"input": {
19+
"location": "this",
20+
"taint": "java.util.Enumeration<String>"
21+
},
22+
"result": {
23+
"location": "returns",
24+
"taint": "java.lang.String"
25+
}
26+
},
27+
{
28+
"comment": "Decoding a header string yields a tainted data string.",
29+
"class": "java.net.URLDecoder",
30+
"method": "decode:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;",
31+
"input": {
32+
"location": "arg0",
33+
"taint": "java.lang.String"
34+
},
35+
"result": {
36+
"location": "returns",
37+
"taint": "java.lang.String"
38+
}
39+
},
40+
{
41+
"comment": "PrintWriter retrieved from ServletResponse is vulnerable.",
42+
"class": "javax.servlet.http.HttpServletResponse",
43+
"method": "getWriter:()Ljava/io/PrintWriter;",
44+
"result": {
45+
"location": "returns",
46+
"taint": "java.io.PrintWriter"
47+
}
48+
},
49+
{
50+
"comment": "Writing HTML header with a tainted data string.",
51+
"class": "javax.servlet.http.HttpServletResponse",
52+
"method": "setHeader:(Ljava/lang/String;Ljava/lang/String;)V",
53+
"input": {
54+
"location": "arg1",
55+
"taint": "java.lang.String"
56+
},
57+
"sinkTarget": {
58+
"location": "this",
59+
"taint": "UNKNOWN"
60+
}
61+
},
62+
{
63+
"comment": "Writing HTML header with a tainted data string.",
64+
"class": "java.io.PrintWriter",
65+
"method": "format:(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintWriter;",
66+
"input": {
67+
"location": "arg2",
68+
"taint": "java.lang.String"
69+
},
70+
"sinkTarget": {
71+
"location": "this",
72+
"taint": "java.io.PrintWriter"
73+
}
74+
}
75+
]
76+
}

0 commit comments

Comments
 (0)