You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Taint flow not tracked when assigning to class attribute and accessing via instance in Python #5713
Taint flow not tracked when assigning to class attribute and accessing via instance in Python
Description
I am testing taint analysis on a Python code snippet where a tainted value is assigned to a class attribute and then accessed via an instance of that class. Joern fails to track the taint flow from the source to the sink in this scenario.
Input Code
The file simple_object_003_T.py contains the following code:
importosdefsimple_object_003_T(taint_src):
classPerson:
pass# Taint is assigned to a class attributePerson.name=taint_src# Create an instance of Personperson=Person()
# Access the class attribute via the instance# This should carry the taint to the sinktaint_sink(person.name)
deftaint_sink(o):
os.system(o)
Steps to Reproduce
Parse the python file using joern-parse:
joern-parse simple_object_003_T.py
Run the following Joern script to check for taint flows:
Joern should detect a taint flow from taint_src (parameter) → Person.name (class attribute assignment) → person.name (instance attribute access) → taint_sink → os.system.
Actual Behavior
No taint flows are found. It seems the data-flow engine does not correctly model the propagation of values from class attributes to instances when the attribute is set on the class object itself.
Activity