From 090ff828a814f08f37ed5e11457d428a5e399d9c Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 11 Jul 2024 17:02:18 +0100 Subject: [PATCH] Convert Mux::RequestVars to MaD --- go/ql/lib/ext/github.com.gorilla.mux.model.yml | 6 ++++++ go/ql/lib/semmle/go/frameworks/Mux.qll | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 go/ql/lib/ext/github.com.gorilla.mux.model.yml diff --git a/go/ql/lib/ext/github.com.gorilla.mux.model.yml b/go/ql/lib/ext/github.com.gorilla.mux.model.yml new file mode 100644 index 0000000000000..c4fb994179aed --- /dev/null +++ b/go/ql/lib/ext/github.com.gorilla.mux.model.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/go-all + extensible: sourceModel + data: + - ["github.com/gorilla/mux", "", True, "Vars", "", "", "ReturnValue", "remote", "manual"] # TODO: should be .MapValue (and .MapKey?) diff --git a/go/ql/lib/semmle/go/frameworks/Mux.qll b/go/ql/lib/semmle/go/frameworks/Mux.qll index 7931ecee700ee..e9bb5968f7023 100644 --- a/go/ql/lib/semmle/go/frameworks/Mux.qll +++ b/go/ql/lib/semmle/go/frameworks/Mux.qll @@ -5,11 +5,17 @@ import go /** + * DEPRECATED + * * Provides classes for working with concepts in the Mux HTTP middleware library. */ -module Mux { - /** An access to a Mux middleware variable. */ - class RequestVars extends DataFlow::RemoteFlowSource::Range, DataFlow::CallNode { +deprecated module Mux { + /** + * DEPRECATED: Use `RemoteFlowSource::Range` instead. + * + * An access to a Mux middleware variable. + */ + deprecated class RequestVars extends DataFlow::RemoteFlowSource::Range, DataFlow::CallNode { RequestVars() { this.getTarget().hasQualifiedName(package("github.com/gorilla/mux", ""), "Vars") }