Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a7f6f04

Browse files
committed
add taint-steps for copying properties of an object
1 parent 7050d9d commit a7f6f04

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

javascript/ql/src/semmle/javascript/security/dataflow/CleartextLoggingCustomizations.qll

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,22 @@ module CleartextLogging {
196196
trg.(DataFlow::SourceNode).flowsTo(write.getBase())
197197
)
198198
or
199+
// A property-copy step,
200+
exists(DataFlow::PropWrite write, DataFlow::PropRead read |
201+
read = write.getRhs()
202+
or
203+
exists(DataFlow::MethodCallNode stringify |
204+
stringify = write.getRhs() and
205+
stringify = DataFlow::globalVarRef("JSON").getAMethodCall("stringify") and
206+
stringify.getArgument(0) = read
207+
)
208+
|
209+
exists(write.getPropertyNameExpr()) and
210+
exists(read.getPropertyNameExpr()) and
211+
src = read.getBase() and
212+
trg = write.getBase().getALocalSource()
213+
)
214+
or
199215
// Taint through the arguments object.
200216
exists(DataFlow::CallNode call, Function f |
201217
src = call.getAnArgument() and

0 commit comments

Comments
 (0)