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

Skip to content

Commit 8ba820c

Browse files
committed
Java: Convert android XML get* methods to CSV based flow source
1 parent 09b0d82 commit 8ba820c

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,30 @@ private predicate sourceModelCsv(string row) {
139139
"javax.servlet.http;Cookie;false;getComment;();;ReturnValue;remote",
140140
// ApacheHttp*
141141
"org.apache.http;HttpMessage;false;getParams;();;ReturnValue;remote",
142-
"org.apache.http;HttpEntity;false;getContent;();;ReturnValue;remote"
142+
"org.apache.http;HttpEntity;false;getContent;();;ReturnValue;remote",
143+
// In the setting of Android we assume that XML has been transmitted over
144+
// the network, so may be tainted.
145+
// XmlPullGetMethod
146+
"org.xmlpull.v1;XmlPullParser;false;getName;();;ReturnValue;remote",
147+
"org.xmlpull.v1;XmlPullParser;false;getNamespace;();;ReturnValue;remote",
148+
"org.xmlpull.v1;XmlPullParser;false;getText;();;ReturnValue;remote",
149+
// XmlAttrSetGetMethod
150+
"android.util;AttributeSet;false;getAttributeBooleanValue;;;ReturnValue;remote",
151+
"android.util;AttributeSet;false;getAttributeCount;;;ReturnValue;remote",
152+
"android.util;AttributeSet;false;getAttributeFloatValue;;;ReturnValue;remote",
153+
"android.util;AttributeSet;false;getAttributeIntValue;;;ReturnValue;remote",
154+
"android.util;AttributeSet;false;getAttributeListValue;;;ReturnValue;remote",
155+
"android.util;AttributeSet;false;getAttributeName;;;ReturnValue;remote",
156+
"android.util;AttributeSet;false;getAttributeNameResource;;;ReturnValue;remote",
157+
"android.util;AttributeSet;false;getAttributeNamespace;;;ReturnValue;remote",
158+
"android.util;AttributeSet;false;getAttributeResourceValue;;;ReturnValue;remote",
159+
"android.util;AttributeSet;false;getAttributeUnsignedIntValue;;;ReturnValue;remote",
160+
"android.util;AttributeSet;false;getAttributeValue;;;ReturnValue;remote",
161+
"android.util;AttributeSet;false;getClassAttribute;;;ReturnValue;remote",
162+
"android.util;AttributeSet;false;getIdAttribute;;;ReturnValue;remote",
163+
"android.util;AttributeSet;false;getIdAttributeResourceValue;;;ReturnValue;remote",
164+
"android.util;AttributeSet;false;getPositionDescription;;;ReturnValue;remote",
165+
"android.util;AttributeSet;false;getStyleAttribute;;;ReturnValue;remote"
143166
]
144167
}
145168

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,6 @@ private class RemoteTaintedMethod extends Method {
216216
RemoteTaintedMethod() {
217217
this instanceof PlayRequestGetMethod or
218218
this instanceof SpringRestTemplateResponseEntityMethod or
219-
// In the setting of Android we assume that XML has been transmitted over
220-
// the network, so may be tainted.
221-
this instanceof XmlPullGetMethod or
222-
this instanceof XmlAttrSetGetMethod or
223219
// The current URL in a browser may be untrusted or uncontrolled.
224220
this instanceof WebViewGetUrlMethod
225221
}

0 commit comments

Comments
 (0)