Skip to content

Commit 3a995ec

Browse files
yoffRasmusWL
andauthored
Update python/ql/lib/semmle/python/security/dataflow/LogInjectionCustomizations.qll
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
1 parent 62598c0 commit 3a995ec

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

python/ql/lib/semmle/python/security/dataflow/LogInjectionCustomizations.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ module LogInjection {
5757
* A call to replace line breaks, considered as a sanitizer.
5858
*/
5959
class ReplaceLineBreaksSanitizer extends Sanitizer, DataFlow::CallCfgNode {
60-
// This is actually not safe:
60+
// Note: This sanitizer is not 100% accurate, since:
6161
// - we do not check that all kinds of line breaks are replaced
6262
// - we do not check that one kind of line breaks is not replaced by another
63-
// however, we lack a simple way to do better, and the query would likely
64-
// be too noisy without this. Consider rewriting using flow states.
63+
//
64+
// However, we lack a simple way to do better, and the query would likely
65+
// be too noisy without this.
66+
//
67+
// TODO: Consider rewriting using flow states.
6568
ReplaceLineBreaksSanitizer() {
6669
this.getFunction().(DataFlow::AttrRead).getAttributeName() = "replace" and
6770
this.getArg(0).asExpr().(StrConst).getText() in ["\r\n", "\n"]

0 commit comments

Comments
 (0)