Open felix-20 opened 1 year ago
@felix-20, @enferas : on the same line of reasoning of @felix-20, cannot we go over the different combinations?
In the original pattern there were comments on the two patterns https://github.com/enferas/TestabilityTarpits/blob/main/PHP/TestabilityPatterns/83_array_variable_key/Pattern%20Array%20Variable%20Key.md
They are the same but we are showing that the index of the array can point one time for the tainted element in the array and one time for a safe element. Thus, tools need to apply over or under approximation for this pattern.
@enferas : some comments for you
Vulnerable or not vulnerable
inconsistency in the original repo: the original README file in https://github.com/enferas/TestabilityTarpits/blob/main/PHP/TestabilityPatterns/83_array_variable_key/Pattern%20Array%20Variable%20Key.md is not in sync with the instances in that patterns. E.g., there are three instances in the folder and 4 in the README
combinations: what about trying to test also cases in which the attacker controlled part goes in the key? see my previous comment (here)[https://github.com/testable-eu/sast-testability-patterns/issues/39#issuecomment-1573962025]
Testability pattern
83_array_variable_key
Problem statement
The php code for instance 2 and instance 3 is the same.
Proposed changes
One possiblity for changing the code of instance 3 I came up with, was this:
The key and the value in
x
are now user controlled. This is of course only one possibility.Other
Do you have any other ideas? Or is it more useful to delete that instance?