From dd87b1a9de94c184612367fc4b349bc2e237ebcc Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 19 Nov 2024 15:20:31 +0000 Subject: [PATCH] Convert `os.stdin` model to MaD --- go/ql/lib/ext/os.model.yml | 1 + go/ql/lib/semmle/go/frameworks/stdlib/Os.qll | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/go/ql/lib/ext/os.model.yml b/go/ql/lib/ext/os.model.yml index 3d87eefe43f7..2c1c64db93ac 100644 --- a/go/ql/lib/ext/os.model.yml +++ b/go/ql/lib/ext/os.model.yml @@ -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"] diff --git a/go/ql/lib/semmle/go/frameworks/stdlib/Os.qll b/go/ql/lib/semmle/go/frameworks/stdlib/Os.qll index fb153451c597..72ea4cc6c573 100644 --- a/go/ql/lib/semmle/go/frameworks/stdlib/Os.qll +++ b/go/ql/lib/semmle/go/frameworks/stdlib/Os.qll @@ -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" } - } }