mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Apply code review comments
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
This commit is contained in:
@@ -12,7 +12,7 @@ private class CookieCleartextStorageSink extends CleartextStorageSink {
|
||||
/** The instantiation of a cookie, which can act as storage. */
|
||||
class Cookie extends Storable, ClassInstanceExpr {
|
||||
Cookie() {
|
||||
this.getConstructor().getDeclaringType().getQualifiedName() = "javax.servlet.http.Cookie"
|
||||
this.getConstructor().getDeclaringType().hasQualifiedName("javax.servlet.http", "Cookie")
|
||||
}
|
||||
|
||||
/** Gets an input, for example `input` in `new Cookie("...", input);`. */
|
||||
@@ -31,7 +31,7 @@ private predicate cookieStore(DataFlow::Node cookie, Expr store) {
|
||||
exists(MethodAccess m, Method def |
|
||||
m.getMethod() = def and
|
||||
def.getName() = "addCookie" and
|
||||
def.getDeclaringType().getQualifiedName() = "javax.servlet.http.HttpServletResponse" and
|
||||
def.getDeclaringType().hasQualifiedName("javax.servlet.http", "HttpServletResponse") and
|
||||
store = m and
|
||||
cookie.asExpr() = m.getAnArgument()
|
||||
)
|
||||
|
||||
@@ -17,13 +17,7 @@ class CleartextStorageAdditionalTaintStep extends Unit {
|
||||
}
|
||||
|
||||
/** Class for expressions that may represent 'sensitive' information */
|
||||
class SensitiveSource extends Expr {
|
||||
SensitiveSource() {
|
||||
// SensitiveExpr is abstract, this lets us inherit from it without
|
||||
// being a technical subclass
|
||||
this instanceof SensitiveExpr
|
||||
}
|
||||
|
||||
class SensitiveSource extends Expr instanceof SensitiveExpr {
|
||||
/** Holds if this source flows to the `sink`. */
|
||||
predicate flowsTo(Expr sink) {
|
||||
exists(SensitiveSourceFlowConfig conf |
|
||||
|
||||
Reference in New Issue
Block a user