Skip to content

Commit 00b4070

Browse files
authored
Merge pull request #9659 from smowton/smowton/admin/invert-java-log-injection-query
Java: Report log-injection at the source rather than the sink
2 parents d13d4c6 + 1f9f6d7 commit 00b4070

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

java/ql/src/Security/CWE/CWE-117/LogInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import DataFlow::PathGraph
1717

1818
from LogInjectionConfiguration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where cfg.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "This $@ flows to a log entry.", source.getNode(),
21-
"user-provided value"
20+
select source.getNode(), source, sink, "This user-provided value flows to a $@.", sink.getNode(),
21+
"log entry"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The query `java/log-injection` now reports problems at the source (user-controlled data) instead of at the ultimate logging call. This was changed because user functions that wrap the ultimate logging call could result in most alerts being reported in an uninformative location.

0 commit comments

Comments
 (0)