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 bf824ca commit dd87b1a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition 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" }
}
}

0 comments on commit dd87b1a

Please sign in to comment.