/
crlf-injection-logs.yaml
85 lines (85 loc) · 2.26 KB
/
crlf-injection-logs.yaml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
rules:
- id: crlf-injection-logs
message: >-
When data from an untrusted source is put into a logger and not neutralized correctly,
an attacker could forge log entries or include malicious content.
metadata:
cwe:
- "CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')"
owasp:
- A03:2021 - Injection
source-rule-url: https://find-sec-bugs.github.io/bugs.htm#CRLF_INJECTION_LOGS
category: security
technology:
- java
references:
- https://owasp.org/Top10/A03_2021-Injection
subcategory:
- vuln
likelihood: LOW
impact: MEDIUM
confidence: MEDIUM
severity: WARNING
languages: [java]
patterns:
# Enumerate possible enclosing scopes that define request and logger
- pattern-either:
# Logger is defined as a field on a class
- patterns:
- pattern-inside: |
class $CLASS {
...
Logger $LOG = ...;
...
}
- pattern-either:
- pattern-inside: |
$X $METHOD(...,HttpServletRequest $REQ,...) {
...
}
- pattern-inside: |
$X $METHOD(...,ServletRequest $REQ,...) {
...
}
- pattern-inside: |
$X $METHOD(...) {
...
HttpServletRequest $REQ = ...;
...
}
- pattern-inside: |
$X $METHOD(...) {
...
ServletRequest $REQ = ...;
...
}
- pattern-inside: |
$X $METHOD(...) {
...
Logger $LOG = ...;
...
HttpServletRequest $REQ = ...;
...
}
- pattern-inside: |
$X $METHOD(...) {
...
Logger $LOG = ...;
...
ServletRequest $REQ = ...;
...
}
- pattern-either:
# Enumerate possible injection sites
- pattern: |
String $VAL = $REQ.getParameter(...);
...
$LOG.$LEVEL(<... $VAL ...>);
- pattern: |
String $VAL = $REQ.getParameter(...);
...
$LOG.log($LEVEL,<... $VAL ...>);
- pattern: |
$LOG.$LEVEL(<... $REQ.getParameter(...) ...>);
- pattern: |
$LOG.log($LEVEL,<... $REQ.getParameter(...) ...>);