File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
python/ql/lib/semmle/python/security/dataflow Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -57,11 +57,14 @@ module LogInjection {
57
57
* A call to replace line breaks, considered as a sanitizer.
58
58
*/
59
59
class ReplaceLineBreaksSanitizer extends Sanitizer , DataFlow:: CallCfgNode {
60
- // This is actually not safe :
60
+ // Note: This sanitizer is not 100% accurate, since :
61
61
// - we do not check that all kinds of line breaks are replaced
62
62
// - 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.
65
68
ReplaceLineBreaksSanitizer ( ) {
66
69
this .getFunction ( ) .( DataFlow:: AttrRead ) .getAttributeName ( ) = "replace" and
67
70
this .getArg ( 0 ) .asExpr ( ) .( StrConst ) .getText ( ) in [ "\r\n" , "\n" ]
You can’t perform that action at this time.
0 commit comments