mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Add modeling for gin
This commit is contained in:
24
go/ql/lib/semmle/go/frameworks/Gin.qll
Normal file
24
go/ql/lib/semmle/go/frameworks/Gin.qll
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Provides classes for modeling the `github.com/gin-gonic/gin` package.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import go
|
||||||
|
import semmle.go.concepts.HTTP
|
||||||
|
|
||||||
|
/** Provides models for the `gin-gonic/gin` package. */
|
||||||
|
module Gin {
|
||||||
|
/** Gets the package name `github.com/gin-gonic/gin`. */
|
||||||
|
string packagePath() { result = package("github.com/gin-gonic/gin", "") }
|
||||||
|
|
||||||
|
private class GinCookieWrite extends Http::CookieWrite::Range, DataFlow::MethodCallNode {
|
||||||
|
GinCookieWrite() { this.getTarget().hasQualifiedName(packagePath(), "Context", "SetCookie") }
|
||||||
|
|
||||||
|
override DataFlow::Node getName() { result = this.getArgument(0) }
|
||||||
|
|
||||||
|
override DataFlow::Node getValue() { result = this.getArgument(1) }
|
||||||
|
|
||||||
|
override DataFlow::Node getSecure() { result = this.getArgument(5) }
|
||||||
|
|
||||||
|
override DataFlow::Node getHttpOnly() { result = this.getArgument(6) }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user