mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Fix code example in query.
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
func ex3(w http.ResponseWriter, r *http.Request) {
|
||||
package main
|
||||
|
||||
import "net/http"
|
||||
|
||||
func example(w http.ResponseWriter, r *http.Request) {
|
||||
test2 := "test"
|
||||
if r.Header.Get("X-Password") != test2 {
|
||||
login()
|
||||
|
||||
@@ -96,9 +96,12 @@ module NoSQL {
|
||||
}
|
||||
}
|
||||
|
||||
predicate isAdditionalMongoTaintStep(DataFlow::Node prev, DataFlow::Node succ) {
|
||||
// Taint bson.E if input is tainted
|
||||
exists(Write w, DataFlow::Node base, Field f | w.writesField(base, f, prev) |
|
||||
/**
|
||||
* Holds if taint flows from `pred` to `succ` through a MongoDB-specific API.
|
||||
*/
|
||||
predicate isAdditionalMongoTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
// Taint an entry if the `Value` is tainted
|
||||
exists(Write w, DataFlow::Node base, Field f | w.writesField(base, f, pred) |
|
||||
base = succ.getASuccessor*() and
|
||||
base.getType().hasQualifiedName(mongoBsonPrimitive(), "E") and
|
||||
f.getName() = "Value"
|
||||
|
||||
Reference in New Issue
Block a user