Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 193458e

Browse files
committed
Java: Convert SpringRestTemplateResponseEntityMethod to CSV based flow source
1 parent e0c51b5 commit 193458e

2 files changed

Lines changed: 6 additions & 5 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
@@ -166,7 +166,11 @@ private predicate sourceModelCsv(string row) {
166166
// The current URL in a browser may be untrusted or uncontrolled.
167167
// WebViewGetUrlMethod
168168
"android.webkit;WebView;false;getUrl;();;ReturnValue;remote",
169-
"android.webkit;WebView;false;getOriginalUrl;();;ReturnValue;remote"
169+
"android.webkit;WebView;false;getOriginalUrl;();;ReturnValue;remote",
170+
// SpringRestTemplateResponseEntityMethod
171+
"org.springframework.web.client;RestTemplate;false;exchange;;;ReturnValue;remote",
172+
"org.springframework.web.client;RestTemplate;false;getForEntity;;;ReturnValue;remote",
173+
"org.springframework.web.client;RestTemplate;false;postForEntity;;;ReturnValue;remote"
170174
]
171175
}
172176

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,7 @@ class DatabaseInput extends LocalUserInput {
213213
}
214214

215215
private class RemoteTaintedMethod extends Method {
216-
RemoteTaintedMethod() {
217-
this instanceof PlayRequestGetMethod or
218-
this instanceof SpringRestTemplateResponseEntityMethod
219-
}
216+
RemoteTaintedMethod() { this instanceof PlayRequestGetMethod }
220217
}
221218

222219
private class PlayRequestGetMethod extends Method {

0 commit comments

Comments
 (0)