Java: Consider some support for backwards flow through writer wrappers
Open
enhancement
Java
- Dominant language
- CodeQL
- Stars
- 10.1k
- Forks
- 2.1k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 141
Description
Consider supporting source to sink flow in the following snippet:
```java
void f(Appendable sink, String source) {
JSONWriter w = new JSONWriter(sink);
w.write(source);
```
Through the model row `"org.json;JSONWriter;true;JSONWriter;;;Argument[-1];Argument[0];taint"`.
Context: https://github.com/github/codeql/pull/6325#discussion_r680984746
Go already has some support for this in https://github.com/github/codeql-go/blob/main/ql/src/semmle/go/dataflow/FunctionInputsAndOutputs.qll#L124.
Contributor guide
Assessment
This issue has not been assessed yet.