Skip to content

Commit ca60f2c

Browse files
Java: Fix failing tests
1 parent ff6c5c2 commit ca60f2c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

java/ql/src/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ private predicate unsafeEscape(MethodAccess ma) {
457457
// Removing `<script>` tags using a string-replace method is
458458
// unsafe if such a tag is embedded inside another one (e.g. `<scr<script>ipt>`).
459459
exists(StringReplaceMethod m | ma.getMethod() = m |
460-
ma.getArgument(0).(StringLiteral).getRepresentedString() = "<script>" and
460+
ma.getArgument(0).(StringLiteral).getRepresentedString() = "(<script>)" and
461461
ma.getArgument(1).(StringLiteral).getRepresentedString() = ""
462462
)
463463
}

java/ql/test/library-tests/dataflow/taint-format/test.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
| A.java:20:22:20:28 | taint(...) | A.java:24:9:24:27 | new ..[] { .. } |
1414
| A.java:20:22:20:28 | taint(...) | A.java:24:24:24:26 | bad |
1515
| A.java:20:22:20:28 | taint(...) | A.java:25:9:25:9 | f |
16+
| A.java:20:22:20:28 | taint(...) | A.java:25:9:25:20 | toString(...) |
1617
| A.java:29:22:29:28 | taint(...) | A.java:29:22:29:28 | taint(...) |
1718
| A.java:29:22:29:28 | taint(...) | A.java:33:9:33:10 | sb |
1819
| A.java:29:22:29:28 | taint(...) | A.java:33:9:33:21 | toString(...) |

0 commit comments

Comments
 (0)