-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert url-redirection sinks to MaD
- Loading branch information
Showing
23 changed files
with
141 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extensions: | ||
- addsTo: | ||
pack: codeql/go-all | ||
extensible: packageGrouping | ||
data: | ||
- ["clever-go", "clevergo.tech/clevergo"] | ||
- ["clever-go", "github.com/clevergo/clevergo"] | ||
- addsTo: | ||
pack: codeql/go-all | ||
extensible: sinkModel | ||
data: | ||
- ["group:clever-go", "Context", True, "Redirect", "", "", "Argument[1]", "url-redirection[receiver]", "manual"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,25 +171,6 @@ private module CleverGo { | |
} | ||
} | ||
|
||
/** | ||
* Models HTTP redirects. | ||
*/ | ||
private class HttpRedirect extends Http::Redirect::Range, DataFlow::CallNode { | ||
DataFlow::Node urlNode; | ||
|
||
HttpRedirect() { | ||
// HTTP redirect models for package: clevergo.tech/[email protected] | ||
// Receiver type: Context | ||
// signature: func (*Context) Redirect(code int, url string) error | ||
this = any(Method m | m.hasQualifiedName(packagePath(), "Context", "Redirect")).getACall() and | ||
urlNode = this.getArgument(1) | ||
} | ||
|
||
override DataFlow::Node getUrl() { result = urlNode } | ||
|
||
override Http::ResponseWriter getResponseWriter() { result.getANode() = this.getReceiver() } | ||
} | ||
|
||
/** | ||
* Models HTTP ResponseBody where the content-type is static and non-modifiable. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,25 +126,6 @@ private module Fiber { | |
} | ||
} | ||
|
||
/** | ||
* Models HTTP redirects. | ||
*/ | ||
private class Redirect extends Http::Redirect::Range, DataFlow::CallNode { | ||
DataFlow::Node urlNode; | ||
|
||
Redirect() { | ||
// HTTP redirect models for package: github.com/gofiber/[email protected] | ||
// Receiver type: Ctx | ||
// signature: func (*Ctx) Redirect(location string, status ...int) | ||
this = any(Method m | m.hasQualifiedName(fiberPackagePath(), "Ctx", "Redirect")).getACall() and | ||
urlNode = this.getArgument(0) | ||
} | ||
|
||
override DataFlow::Node getUrl() { result = urlNode } | ||
|
||
override Http::ResponseWriter getResponseWriter() { result.getANode() = this.getReceiver() } | ||
} | ||
|
||
/** | ||
* Models HTTP header writers. | ||
* The write is done with a call where you can set both the key and the value of the header. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.