Skip to content

Commit

Permalink
Convert os.stdin model to MaD
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-mc committed Nov 19, 2024
1 parent 9974849 commit a92186d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions go/ql/lib/ext/os.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ extensions:
- ["os", "", False, "Open", "", "", "ReturnValue[0]", "file", "manual"]
- ["os", "", False, "OpenFile", "", "", "ReturnValue[0]", "file", "manual"]
- ["os", "", False, "ReadFile", "", "", "ReturnValue[0]", "file", "manual"]
- ["os", "", False, "Stdin", "", "", "", "stdin", "manual"]
- ["os", "", False, "UserCacheDir", "", "", "ReturnValue[0]", "environment", "manual"]
- ["os", "", False, "UserConfigDir", "", "", "ReturnValue[0]", "environment", "manual"]
- ["os", "", False, "UserHomeDir", "", "", "ReturnValue[0]", "environment", "manual"]
8 changes: 0 additions & 8 deletions go/ql/lib/semmle/go/frameworks/stdlib/Os.qll
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,4 @@ module Os {
input = inp and output = outp
}
}

private class Stdin extends SourceNode {
Stdin() {
exists(Variable osStdin | osStdin.hasQualifiedName("os", "Stdin") | this = osStdin.getARead())
}

override string getThreatModel() { result = "stdin" }
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
testFailures
| test.go:19:24:19:57 | comment | Missing result: hasTaintFlow="type conversion" |
| test.go:29:24:29:57 | comment | Missing result: hasTaintFlow="type conversion" |
invalidModelRow

0 comments on commit a92186d

Please sign in to comment.