File tree Expand file tree Collapse file tree
test/soot/jimple/infoflow/test/methodSummary Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 <methods >
44 <method id =" java.lang.String toString()" >
55 <flows >
6- <flow isAlias =" false" typeChecking =" false" >
6+ <flow isAlias =" false" typeChecking =" false" cutSubfields = " true " >
77 <from sourceSinkType =" Field" />
88 <to sourceSinkType =" Return" />
99 </flow >
Original file line number Diff line number Diff line change 855855 <from sourceSinkType =" Field"
856856 AccessPath=" [java.math.BigDecimal: java.lang.Object value]"
857857 AccessPathTypes=" [java.lang.Object]" />
858- <to sourceSinkType =" Return"
859- AccessPath=" [java.math.BigDecimal: java.lang.Object value]"
860- AccessPathTypes=" [java.lang.Object]" />
858+ <to sourceSinkType =" Return" />
861859 </flow >
862860 </flows >
863861 </method >
Original file line number Diff line number Diff line change 470470 <flow isAlias =" false" typeChecking =" false" >
471471 <from sourceSinkType =" Field" AccessPath =" [java.math.BigInteger: java.lang.Object value]"
472472 AccessPathTypes=" [java.lang.Object]" />
473- <to sourceSinkType =" Return" AccessPath =" [java.math.BigInteger: java.lang.Object value]"
474- AccessPathTypes=" [java.lang.Object]" />
473+ <to sourceSinkType =" Return" />
475474 </flow >
476475 </flows >
477476 </method >
Original file line number Diff line number Diff line change 33import java .io .ByteArrayOutputStream ;
44import java .io .ObjectOutputStream ;
55import java .io .ObjectOutputStream .PutField ;
6+ import java .math .BigInteger ;
7+ import java .util .HashMap ;
8+ import java .util .Map ;
69
710public class ApiClassClient {
811 public Object source () {
@@ -275,4 +278,28 @@ public void killTaint2() {
275278 sink (collection .get ());
276279 }
277280
281+ public void taintedFieldToString () {
282+ Data d = new Data ();
283+ d .objectField = source ();
284+ // in: d.objectField
285+ // expected out: str (not str.objectField!)
286+ String str = d .toString ();
287+ char c = str .charAt (2 );
288+ sink (c );
289+ }
290+
291+ public void bigIntegerToString () {
292+ BigInteger i = new BigInteger (stringSource ());
293+ String str = i .toString ();
294+ char c = str .charAt (2 );
295+ sink (c );
296+ }
297+
298+ public void mapToString () {
299+ Map <String , String > map = new HashMap <>();
300+ map .put ("Secret" , stringSource ());
301+ String str = map .toString ();
302+ char c = str .charAt (2 );
303+ sink (c );
304+ }
278305}
Original file line number Diff line number Diff line change @@ -212,6 +212,21 @@ public void killTaint2() {
212212 testNoFlowForMethod ("<soot.jimple.infoflow.test.methodSummary.ApiClassClient: void killTaint2()>" );
213213 }
214214
215+ @ Test (timeout = 30000 )
216+ public void taintedFieldToString () {
217+ testFlowForMethod ("<soot.jimple.infoflow.test.methodSummary.ApiClassClient: void taintedFieldToString()>" );
218+ }
219+
220+ @ Test (timeout = 30000 )
221+ public void bigIntegerToString () {
222+ testFlowForMethod ("<soot.jimple.infoflow.test.methodSummary.ApiClassClient: void bigIntegerToString()>" );
223+ }
224+
225+ @ Test (timeout = 30000 )
226+ public void mapToString () {
227+ testFlowForMethod ("<soot.jimple.infoflow.test.methodSummary.ApiClassClient: void mapToString()>" );
228+ }
229+
215230 @ Test
216231 public void testAllSummaries () throws URISyntaxException , IOException {
217232 EagerSummaryProvider provider = new EagerSummaryProvider (TaintWrapperFactory .DEFAULT_SUMMARY_DIR );
You can’t perform that action at this time.
0 commit comments