-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathNettyResponseSplitting.ql
More file actions
41 lines (35 loc) · 1.6 KB
/
NettyResponseSplitting.ql
File metadata and controls
41 lines (35 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* @name Disabled Netty HTTP header validation
* @description Disabling HTTP header validation makes code vulnerable to
* attack by header splitting if user input is written directly to
* an HTTP header.
* @kind problem
* @problem.severity error
* @security-severity 6.1
* @precision high
* @id java/netty-http-response-splitting
* @tags security
* external/cwe/cwe-113
*/
import java
abstract private class InsecureNettyObjectCreation extends ClassInstanceExpr { }
private class InsecureDefaultHttpHeadersClassInstantiation extends InsecureNettyObjectCreation {
InsecureDefaultHttpHeadersClassInstantiation() {
getConstructedType().hasQualifiedName("io.netty.handler.codec.http", "DefaultHttpHeaders") and
getArgument(0).(CompileTimeConstantExpr).getBooleanValue() = false
}
}
private class InsecureDefaultHttpResponseClassInstantiation extends InsecureNettyObjectCreation {
InsecureDefaultHttpResponseClassInstantiation() {
getConstructedType().hasQualifiedName("io.netty.handler.codec.http", "DefaultHttpResponse") and
getArgument(2).(CompileTimeConstantExpr).getBooleanValue() = false
}
}
private class InsecureDefaultFullHttpResponseClassInstantiation extends InsecureNettyObjectCreation {
InsecureDefaultFullHttpResponseClassInstantiation() {
getConstructedType().hasQualifiedName("io.netty.handler.codec.http", "DefaultFullHttpResponse") and
getArgument(3).(CompileTimeConstantExpr).getBooleanValue() = false
}
}
from InsecureNettyObjectCreation new
select new, "Response-splitting vulnerability due to header value verification being disabled."