mirror of
https://github.com/github/codeql.git
synced 2026-01-29 14:23:03 +01:00
Simplify net/http ResponseBody logic
This commit is contained in:
committed by
Chris Smowton
parent
8a306af77b
commit
a78c35b95e
@@ -145,16 +145,10 @@ module NetHttp {
|
||||
responseWriter = call.(DataFlow::MethodCallNode).getReceiver()
|
||||
)
|
||||
or
|
||||
exists(
|
||||
TaintTracking::FunctionModel model, FunctionOutput modelOutput, FunctionInput modelInput,
|
||||
DataFlow::CallNode call
|
||||
|
|
||||
exists(TaintTracking::FunctionModel model |
|
||||
// A modelled function conveying taint from some input to the response writer,
|
||||
// e.g. `io.Copy(responseWriter, someTaintedReader)`
|
||||
call = model.getACall() and
|
||||
model.hasTaintFlow(modelInput, modelOutput) and
|
||||
this = modelInput.getNode(call) and
|
||||
responseWriter = modelOutput.getNode(call).(DataFlow::PostUpdateNode).getPreUpdateNode() and
|
||||
model.taintStep(this, responseWriter) and
|
||||
responseWriter.getType().implements("net/http", "ResponseWriter")
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user