Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions java/ql/lib/change-notes/2025-10-07-array-entrypointtype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Fields of certain objects are considered tainted if the object is tainted. This holds, for example, for objects that occur directly as sources in the active threat model (for instance, a remote flow source). This has now been amended to also include array types, such that if an array like `MyPojo[]` is a source, then fields of a tainted `MyPojo` are now also considered tainted.
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,8 @@ private SrcRefType entrypointType() {
)
or
result = entrypointType().getAField().getType().(RefType).getSourceDeclaration()
or
result = entrypointType().(Array).getElementType().(RefType).getSourceDeclaration()
}

private predicate entrypointFieldStep(DataFlow::Node src, DataFlow::Node sink) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class UnrelatedObject {
public String safeField;
}

static class ArrayElemObject {
public String field;
}

private static void sink(String sink) {}

public static void test(TestObject source) {
Expand Down Expand Up @@ -70,4 +74,8 @@ public static void testSubtype(ParameterizedTestObject<?, ?> source) {
UnrelatedObject unrelated = (UnrelatedObject) subtypeSource.getField8();
sink(unrelated.safeField); // Safe
}

public static void testArray(ArrayElemObject[] source) {
sink(source[0].field); // $hasTaintFlow
}
}