Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TP: Java: Multiple patterns / confounding factor / generics #18

Open
vlkl-sap opened this issue Feb 10, 2023 · 0 comments
Open
Labels
ACK_WAITING issue to be reviewed and confirmed UPDATE_TP issue is about updating a testability pattern

Comments

@vlkl-sap
Copy link

Testability pattern

Consider 103_arrays_aslist:

String s = request.getParameter("t1");
String [] stringArr = {s};
List l = Arrays.asList(stringArr);
response.getWriter().write(l.get(0).toString());

Problem statement

Some tools are apparently tripping up on the fact that l is declared as a List rather than a List<String>, i.e., they fail to track the full type of the list object that l points to. This failure has nothing to do with the intent of the pattern and should be tested for in a separate pattern, but not here.

In other tools, this failure could be masked, if they assume that toString() propagates taint for all objects.

There are also other patterns/instances that have the same problem, but I did not bother to review them all. Candidates:
102_collection_taint_propagation, 24_arraylist

Proposed changes

Other

@vlkl-sap vlkl-sap added ACK_WAITING issue to be reviewed and confirmed UPDATE_TP issue is about updating a testability pattern labels Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ACK_WAITING issue to be reviewed and confirmed UPDATE_TP issue is about updating a testability pattern
Projects
None yet
Development

No branches or pull requests

1 participant