Skip to content

Commit bd14ade

Browse files
committed
python: add apologetic comment
1 parent f21ac04 commit bd14ade

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ module LogInjection {
5757
* A call to replace line breaks functions as a sanitizer.
5858
*/
5959
class ReplaceLineBreaksSanitizer extends Sanitizer, DataFlow::CallCfgNode {
60+
// This is actually not safe:
61+
// - we do not check that all kinds of line breaks are replaced
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.
6065
ReplaceLineBreaksSanitizer() {
6166
this.getFunction().(DataFlow::AttrRead).getAttributeName() = "replace" and
6267
this.getArg(0).asExpr().(StrConst).getText() in ["\r\n", "\n"]

0 commit comments

Comments
 (0)