Skip to content

Commit 37f4410

Browse files
committed
Fix test
1 parent 14ce049 commit 37f4410

File tree

6 files changed

+95
-84
lines changed

6 files changed

+95
-84
lines changed

java/ql/test/experimental/query-tests/security/CWE-074/XsltInjection.expected

Lines changed: 75 additions & 75 deletions
Large diffs are not rendered by default.

java/ql/test/experimental/query-tests/security/CWE-074/XsltInjection.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import javax.xml.transform.stream.StreamResult;
1616
import javax.xml.transform.stream.StreamSource;
1717

18+
import org.springframework.web.bind.annotation.RequestMapping;
1819
import org.springframework.web.bind.annotation.RequestParam;
1920
import org.xml.sax.InputSource;
2021

@@ -33,6 +34,7 @@ public void testStreamSourceReader(Socket socket) throws Exception {
3334
TransformerFactory.newInstance().newTemplates(source).newTransformer().transform(null, null);
3435
}
3536

37+
@RequestMapping
3638
public void testStreamSourceInjectedParam(@RequestParam String param) throws Exception {
3739
String xslt = "<xsl:stylesheet [...]" + param + "</xsl:stylesheet>";
3840
StreamSource source = new StreamSource(new StringReader(xslt));
@@ -95,6 +97,7 @@ public void testSaxon(Socket socket) throws Exception {
9597
compiler.compile(source).load30().callTemplate(null, null);
9698
}
9799

100+
@RequestMapping
98101
public void testSaxonXsltPackage(@RequestParam String param, Socket socket) throws Exception {
99102
URI uri = new URI(param);
100103
StreamSource source = new StreamSource(socket.getInputStream());
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/springframework-5.2.3:${testdir}/../../../stubs/Saxon-HE-9.9.1-7
1+
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/springframework-5.2.3:${testdir}/../../../stubs/Saxon-HE-9.9.1-7

java/ql/test/experimental/stubs/springframework-5.2.3/org/springframework/web/bind/annotation/RequestParam.java

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.springframework.web.bind.annotation;
2+
3+
import java.lang.annotation.*;
4+
5+
@Target({ElementType.ANNOTATION_TYPE})
6+
@Retention(RetentionPolicy.RUNTIME)
7+
public @interface Mapping { }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.springframework.web.bind.annotation;
2+
3+
import java.lang.annotation.*;
4+
5+
@Target({ElementType.TYPE, ElementType.METHOD})
6+
@Retention(RetentionPolicy.RUNTIME)
7+
@Documented
8+
@Mapping
9+
public @interface RequestMapping { }

0 commit comments

Comments
 (0)