Apply code review comments

Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
This commit is contained in:
Tony Torralba
2021-09-23 15:48:15 +02:00
parent d0b9920cac
commit b52a2cd292
2 changed files with 3 additions and 9 deletions

View File

@@ -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()
)

View File

@@ -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 |