mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Merge pull request #9947 from github/smowton/fix/golang-path-injection-numeric-sanitizer
Go: note that numeric-typed nodes can't cause path traversal
This commit is contained in:
@@ -70,6 +70,15 @@ module TaintedPath {
|
||||
PathAsSink() { this = any(FileSystemAccess fsa).getAPathArgument() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A numeric- or boolean-typed node, considered a sanitizer for path traversal.
|
||||
*/
|
||||
class NumericOrBooleanSanitizer extends Sanitizer {
|
||||
NumericOrBooleanSanitizer() {
|
||||
this.getType() instanceof NumericType or this.getType() instanceof BoolType
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A call to `filepath.Rel`, considered as a sanitizer for path traversal.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* The query `go/path-injection` no longer considers user-controlled numeric or boolean-typed data as potentially dangerous.
|
||||
Reference in New Issue
Block a user