Esempio n. 1
0
def obscure_test(obj):
    return type(obj)(__test_source())
Esempio n. 2
0
def create_zipped_source_with_all_tainted():
    x = [__test_source()]
    y = [__test_source()]
    z = [__test_source()]
    return zip(x, y, z)
Esempio n. 3
0
def partial_application_with_tainted():
    x = __test_source()
    partial(a_flows_to_sink, x)
Esempio n. 4
0
def test():
    query = {"json": __test_source()}
    sink(query)
Esempio n. 5
0
def test():
    client.get_instance().offer(__test_source())
Esempio n. 6
0
def source_via_format():
    taint = __test_source()
    return f"{taint} is bad"
Esempio n. 7
0
def first_index_numeric():
    x = __test_source()
    return x[0]
Esempio n. 8
0
def float_source() -> float:
    return __test_source()
Esempio n. 9
0
def bool_source() -> bool:
    return __test_source()
Esempio n. 10
0
def local_function_with_method_sink(c: C):
    f = c.m
    x = __test_source()
    c.m(x)
    f(x)
Esempio n. 11
0
def issue_via_in():
    o = __test_source()
    __test_sink("a" in o)
    __test_sink(o in "a")
Esempio n. 12
0
def foo_as_local():
    x = __test_source()
    f = foo
    foo(x)
    f(x)
Esempio n. 13
0
 def also_tainted_but_missing_from_analysis():
     return __test_source()
Esempio n. 14
0
 def foo():
     return __test_source()
Esempio n. 15
0
 def writes_to_property(self):
     self.my_property = __test_source()
Esempio n. 16
0
def int_source() -> int:
    return __test_source()
Esempio n. 17
0
def sets_tainted_value(t: TaintedGetterAndSetter) -> None:
    t.my_property = __test_source()
Esempio n. 18
0
def issue_via_bool():
    o = __test_source()
    x = bool(o)
    __test_sink(x)
Esempio n. 19
0
def first_index():
    x = __test_source()
    return x["access_token"]
Esempio n. 20
0
def returns_tainted_object() -> object:
    return __test_source()
Esempio n. 21
0
def first_index_unknown():
    x = __test_source()
    unknown = "some text"
    return x[unknown]
Esempio n. 22
0
async def async_tuple_of_bools() -> Tuple[bool, bool]:
    return __test_source(), __test_source()
Esempio n. 23
0
def bar():
    Test.foo(__test_source())
Esempio n. 24
0
 def uses_property(self):
     self.tainted = __test_source()
     return self.my_property
Esempio n. 25
0
def create_zipped_source():
    x = [__test_source(), 1]
    y = [2, 3]
    return zip(x, y)
Esempio n. 26
0
 def my_property(self) -> str:
     return __test_source()
Esempio n. 27
0
def main() -> None:
    foo(__test_source())
    foo_with_sink(__test_source())
    await foo_async(__test_source())
Esempio n. 28
0
 def uses_property_but_no_tito_taint(self):
     self.untainted = __test_source()
     return self.my_property
Esempio n. 29
0
def partial_application_with_named_b():
    x = __test_source()
    partial(a_flows_to_sink, b=x)
Esempio n. 30
0
def test_attribute_via_dunder_dict():
    obj = UseViaDict(a=__test_source(), b=None)
    # First two should be flows, and the third shouldn't.
    __test_sink(obj.__dict__)
    __test_sink(obj.__dict__["a"])
    __test_sink(obj.__dict__["b"])