Skip to content

Commit 3c8ac5c

Browse files
committed
Java: Convert Cookie.get* methods to CSV based flow source
1 parent 86cf143 commit 3c8ac5c

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

java/ql/src/semmle/code/java/dataflow/ExternalFlow.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ private predicate sourceModelCsv(string row) {
132132
// TODO consider org.springframework.web.context.request.WebRequest.getRemoteUser
133133
// ServletRequestGetBodyMethod
134134
"javax.servlet;ServletRequest;false;getInputStream;();;ReturnValue;remote",
135-
"javax.servlet;ServletRequest;false;getReader;();;ReturnValue;remote"
135+
"javax.servlet;ServletRequest;false;getReader;();;ReturnValue;remote",
136+
// CookieGet*
137+
"javax.servlet.http;Cookie;false;getValue;();;ReturnValue;remote",
138+
"javax.servlet.http;Cookie;false;getName;();;ReturnValue;remote",
139+
"javax.servlet.http;Cookie;false;getComment;();;ReturnValue;remote"
136140
]
137141
}
138142

java/ql/src/semmle/code/java/dataflow/FlowSources.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,6 @@ private class RemoteTaintedMethod extends Method {
216216
RemoteTaintedMethod() {
217217
this instanceof PlayRequestGetMethod or
218218
this instanceof SpringRestTemplateResponseEntityMethod or
219-
this instanceof CookieGetValueMethod or
220-
this instanceof CookieGetNameMethod or
221-
this instanceof CookieGetCommentMethod or
222219
this instanceof ApacheHttpGetParams or
223220
this instanceof ApacheHttpEntityGetContent or
224221
// In the setting of Android we assume that XML has been transmitted over

0 commit comments

Comments
 (0)