diff --git a/benchmarks/measurements/2026-09-06-corpus-hygiene.json b/benchmarks/measurements/2026-09-06-corpus-hygiene.json index b0ce12b..8f72f88 100644 --- a/benchmarks/measurements/2026-09-06-corpus-hygiene.json +++ b/benchmarks/measurements/2026-09-06-corpus-hygiene.json @@ -92,6 +92,8 @@ "owasp-java-hash" ], "note": "Repositories in `straddling` have pairs on both sides of the train/holdout split, so a learning path can be taught by one file of a repository and evaluated on another. Pairs in `duplicate_groups` share a vulnerable excerpt byte for byte after the provenance header is stripped. Both cap what any detector number can mean. Groups in `cross_split_duplicates` sit on both sides of the split while being the same code, so the train row teaches the holdout row exactly; forks of one project defeat the repository-level split.", + "owasp_note": "The 40 vendored BenchmarkJava xss pairs are all holdout. OWASP-Benchmark/BenchmarkJava already straddled the split before them (owasp-java-cmdi train, owasp-java-sqli holdout), so the new pairs enlarge an existing straddle rather than create one. It matters less than it did -- the learning path a train row could teach is deleted -- but it is recorded, not hidden.", + "regenerated": "2026-09-08 after the owasp slice was vendored", "straddling": [ [ "Contrast-Security-OSS/DjanGoat", @@ -121,7 +123,47 @@ [ "owasp-java-cmdi", "owasp-java-hash", - "owasp-java-sqli" + "owasp-java-sqli", + "owasp-xss-benchmarktest00013", + "owasp-xss-benchmarktest00014", + "owasp-xss-benchmarktest00030", + "owasp-xss-benchmarktest00036", + "owasp-xss-benchmarktest00041", + "owasp-xss-benchmarktest00144", + "owasp-xss-benchmarktest00145", + "owasp-xss-benchmarktest00146", + "owasp-xss-benchmarktest00148", + "owasp-xss-benchmarktest00149", + "owasp-xss-benchmarktest00150", + "owasp-xss-benchmarktest00152", + "owasp-xss-benchmarktest00153", + "owasp-xss-benchmarktest00154", + "owasp-xss-benchmarktest00155", + "owasp-xss-benchmarktest00156", + "owasp-xss-benchmarktest00157", + "owasp-xss-benchmarktest00276", + "owasp-xss-benchmarktest00279", + "owasp-xss-benchmarktest00280", + "owasp-xss-benchmarktest00284", + "owasp-xss-benchmarktest00287", + "owasp-xss-benchmarktest00290", + "owasp-xss-benchmarktest00291", + "owasp-xss-benchmarktest00292", + "owasp-xss-benchmarktest00301", + "owasp-xss-benchmarktest00375", + "owasp-xss-benchmarktest00376", + "owasp-xss-benchmarktest00378", + "owasp-xss-benchmarktest00380", + "owasp-xss-benchmarktest00382", + "owasp-xss-benchmarktest00383", + "owasp-xss-benchmarktest00384", + "owasp-xss-benchmarktest00385", + "owasp-xss-benchmarktest00387", + "owasp-xss-benchmarktest00388", + "owasp-xss-benchmarktest00390", + "owasp-xss-benchmarktest00392", + "owasp-xss-benchmarktest00395", + "owasp-xss-benchmarktest00467" ] ], [ @@ -423,5 +465,5 @@ "train" ] ], - "vendored_pairs": 277 + "vendored_pairs": 317 } diff --git a/benchmarks/pairs/owasp/catalog.toml b/benchmarks/pairs/owasp/catalog.toml new file mode 100644 index 0000000..a0d9912 --- /dev/null +++ b/benchmarks/pairs/owasp/catalog.toml @@ -0,0 +1,1068 @@ +# OWASP BenchmarkJava slice — cross-site scripting (model-grounded-detection corpus expansion). +# slice = "owasp" +# +# WHAT THIS IS. Generated SAST-benchmark servlets, not real-world code. The slice measures BREADTH across a +# weakness class; it must never stand in for real-world performance, and its numbers belong in their own row. +# The corpus already shows a +16% overfitting gap between the development slice and the deciding real-world +# one, and a large synthetic slice blended into a headline would widen that invisibly. +# +# GROUND TRUTH is the suite's own expectedresults-1.2.csv, which states per test whether it is really +# vulnerable. A pair is a really-vulnerable test matched with the safe test of the SAME category it most +# resembles: adjacent tests come from one template, so the two differ in the sink or the sanitiser rather +# than being unrelated programs. Every pair here is >= 0.75 similar (median 0.91), against the 64% of the +# older `sast` OWASP entries that the group-4 stratification flagged as "different programs". +# +# WHY ONLY XSS. Seven categories were harvested and one representative of each was run through the model +# before vendoring. Only xss distinguished: its fix adds ESAPI encoding, which the Java sanitizer facts +# recognise. cmdi, sqli, ldapi and xpathi put the sink in a helper class outside the servlet and resolved no +# flow at all; pathtraver found the flow but its "safe" twin carries no distinguishing call, so text +# similarity had matched a twin that is not semantically the fix. Those 198 pairs are deliberately NOT +# vendored: adding pairs the model cannot read would inflate the corpus while making every number less +# interpretable. +# +# EVIDENCE for this slice is 3 of 3 pairs distinguished (model_entailed on the vulnerable side, dropping to +# model_corroborated on the fixed one). That is a small sample and is stated as such; the slice's own +# measurement is the real check. +# +# LICENCE: GPL-2.0, per BenchmarkJava's LICENSE file. The older `sast` entries declare GPL-3.0 for OWASP; +# that appears to be an error and is not copied here. + +[[pair]] +name = "owasp-xss-benchmarktest00013" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00013.java" +fixed = "java/BenchmarkTest00282.java" +relpath = "testcode/BenchmarkTest00013.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.952 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00013.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00014" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00014.java" +fixed = "java/BenchmarkTest00282.java" +relpath = "testcode/BenchmarkTest00014.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.957 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00014.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00030" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00030.java" +fixed = "java/BenchmarkTest00282.java" +relpath = "testcode/BenchmarkTest00030.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.823 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00030.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00036" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00036.java" +fixed = "java/BenchmarkTest00283.java" +relpath = "testcode/BenchmarkTest00036.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.753 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00036.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00041" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00041.java" +fixed = "java/BenchmarkTest00289.java" +relpath = "testcode/BenchmarkTest00041.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.798 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00041.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00144" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00144.java" +fixed = "java/BenchmarkTest00151.java" +relpath = "testcode/BenchmarkTest00144.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.987 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00144.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00145" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00145.java" +fixed = "java/BenchmarkTest00288.java" +relpath = "testcode/BenchmarkTest00145.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.884 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00145.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00146" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00146.java" +fixed = "java/BenchmarkTest00282.java" +relpath = "testcode/BenchmarkTest00146.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.887 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00146.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00148" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00148.java" +fixed = "java/BenchmarkTest00281.java" +relpath = "testcode/BenchmarkTest00148.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.914 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00148.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00149" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00149.java" +fixed = "java/BenchmarkTest00282.java" +relpath = "testcode/BenchmarkTest00149.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.919 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00149.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00150" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00150.java" +fixed = "java/BenchmarkTest00281.java" +relpath = "testcode/BenchmarkTest00150.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.921 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00150.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00152" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00152.java" +fixed = "java/BenchmarkTest00283.java" +relpath = "testcode/BenchmarkTest00152.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.839 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00152.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00153" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00153.java" +fixed = "java/BenchmarkTest00288.java" +relpath = "testcode/BenchmarkTest00153.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.893 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00153.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00154" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00154.java" +fixed = "java/BenchmarkTest00285.java" +relpath = "testcode/BenchmarkTest00154.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.838 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00154.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00155" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00155.java" +fixed = "java/BenchmarkTest00285.java" +relpath = "testcode/BenchmarkTest00155.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.914 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00155.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00156" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00156.java" +fixed = "java/BenchmarkTest00151.java" +relpath = "testcode/BenchmarkTest00156.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.98 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00156.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00157" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00157.java" +fixed = "java/BenchmarkTest00281.java" +relpath = "testcode/BenchmarkTest00157.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.927 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00157.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00276" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00276.java" +fixed = "java/BenchmarkTest00281.java" +relpath = "testcode/BenchmarkTest00276.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.967 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00276.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00279" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00279.java" +fixed = "java/BenchmarkTest00278.java" +relpath = "testcode/BenchmarkTest00279.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.914 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00279.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00280" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00280.java" +fixed = "java/BenchmarkTest00285.java" +relpath = "testcode/BenchmarkTest00280.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.877 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00280.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00284" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00284.java" +fixed = "java/BenchmarkTest00285.java" +relpath = "testcode/BenchmarkTest00284.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.986 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00284.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00287" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00287.java" +fixed = "java/BenchmarkTest00286.java" +relpath = "testcode/BenchmarkTest00287.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.96 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00287.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00290" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00290.java" +fixed = "java/BenchmarkTest00289.java" +relpath = "testcode/BenchmarkTest00290.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.966 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00290.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00291" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00291.java" +fixed = "java/BenchmarkTest00289.java" +relpath = "testcode/BenchmarkTest00291.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.962 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00291.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00292" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00292.java" +fixed = "java/BenchmarkTest00289.java" +relpath = "testcode/BenchmarkTest00292.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.927 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00292.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00301" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00301.java" +fixed = "java/BenchmarkTest00288.java" +relpath = "testcode/BenchmarkTest00301.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.936 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00301.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00375" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00375.java" +fixed = "java/BenchmarkTest00381.java" +relpath = "testcode/BenchmarkTest00375.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.958 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00375.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00376" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00376.java" +fixed = "java/BenchmarkTest00393.java" +relpath = "testcode/BenchmarkTest00376.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.963 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00376.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00378" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00378.java" +fixed = "java/BenchmarkTest00391.java" +relpath = "testcode/BenchmarkTest00378.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.946 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00378.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00380" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00380.java" +fixed = "java/BenchmarkTest00391.java" +relpath = "testcode/BenchmarkTest00380.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.857 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00380.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00382" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00382.java" +fixed = "java/BenchmarkTest00377.java" +relpath = "testcode/BenchmarkTest00382.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.976 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00382.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00383" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00383.java" +fixed = "java/BenchmarkTest00379.java" +relpath = "testcode/BenchmarkTest00383.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.938 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00383.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00384" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00384.java" +fixed = "java/BenchmarkTest00381.java" +relpath = "testcode/BenchmarkTest00384.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.939 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00384.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00385" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00385.java" +fixed = "java/BenchmarkTest00379.java" +relpath = "testcode/BenchmarkTest00385.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.909 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00385.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00387" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00387.java" +fixed = "java/BenchmarkTest00393.java" +relpath = "testcode/BenchmarkTest00387.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.977 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00387.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00388" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00388.java" +fixed = "java/BenchmarkTest00391.java" +relpath = "testcode/BenchmarkTest00388.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.955 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00388.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00390" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00390.java" +fixed = "java/BenchmarkTest00391.java" +relpath = "testcode/BenchmarkTest00390.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.907 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00390.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00392" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00392.java" +fixed = "java/BenchmarkTest00389.java" +relpath = "testcode/BenchmarkTest00392.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.892 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00392.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00395" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00395.java" +fixed = "java/BenchmarkTest00391.java" +relpath = "testcode/BenchmarkTest00395.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.931 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00395.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" + +[[pair]] +name = "owasp-xss-benchmarktest00467" +slice = "owasp" +language = "java" +origin = "owasp-benchmark-java" +license = "GPL-2.0" +repo = "OWASP-Benchmark/BenchmarkJava" +cwe = "CWE-79" +vuln = "java/BenchmarkTest00467.java" +fixed = "java/BenchmarkTest00468.java" +relpath = "testcode/BenchmarkTest00467.java" +min_recall = 1.0 +fix_policy = "silent" +provenance = "synthetic" +split = "holdout" +# template similarity to its safe twin, measured at harvest: 0.969 + +[[pair.expected]] +cwe = "CWE-79" +family = "output_encoding" +class = "cross-site scripting" +path = "testcode/BenchmarkTest00467.java" +function = "doPost" +evidence = "marked really-vulnerable in expectedresults-1.2.csv; the twin encodes with ESAPI" +mechanism = "container_taint" diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00013.java b/benchmarks/pairs/owasp/java/BenchmarkTest00013.java new file mode 100644 index 0000000..0073b0e --- /dev/null +++ b/benchmarks/pairs/owasp/java/BenchmarkTest00013.java @@ -0,0 +1,58 @@ +/** + * OWASP Benchmark v1.2 + * + *
This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For + * details, please see https://owasp.org/www-project-benchmark/. + * + *
The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Foundation, version 2. + * + *
The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Dave Wichers
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00013")
+public class BenchmarkTest00013 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ // some code
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Dave Wichers
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00014")
+public class BenchmarkTest00014 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ // some code
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Dave Wichers
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00030")
+public class BenchmarkTest00030 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ // some code
+ response.setContentType("text/html;charset=UTF-8");
+
+ java.util.Map This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Dave Wichers
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00036")
+public class BenchmarkTest00036 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ // some code
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ boolean flag = true;
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Dave Wichers
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00041")
+public class BenchmarkTest00041 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ // some code
+ response.setContentType("text/html;charset=UTF-8");
+
+ org.owasp.benchmark.helpers.SeparateClassRequest scr =
+ new org.owasp.benchmark.helpers.SeparateClassRequest(request);
+ String param = scr.getTheParameter("BenchmarkTest00041");
+ if (param == null) param = "";
+
+ response.setHeader("X-XSS-Protection", "0");
+ int length = 1;
+ if (param != null) {
+ length = param.length();
+ response.getWriter().write(param, 0, length);
+ }
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00144.java b/benchmarks/pairs/owasp/java/BenchmarkTest00144.java
new file mode 100644
index 0000000..4638da6
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00144.java
@@ -0,0 +1,67 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00144")
+public class BenchmarkTest00144 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar = "";
+ if (param != null) {
+ java.util.List This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00145")
+public class BenchmarkTest00145 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar = "safe!";
+ java.util.HashMap This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00146")
+public class BenchmarkTest00146 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar = param;
+ if (param != null && param.length() > 1) {
+ StringBuilder sbxyz67327 = new StringBuilder(param);
+ bar = sbxyz67327.replace(param.length() - "Z".length(), param.length(), "Z").toString();
+ }
+
+ response.setHeader("X-XSS-Protection", "0");
+ Object[] obj = {"a", "b"};
+ response.getWriter().format(java.util.Locale.US, bar, obj);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00148.java b/benchmarks/pairs/owasp/java/BenchmarkTest00148.java
new file mode 100644
index 0000000..368d66c
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00148.java
@@ -0,0 +1,62 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00148")
+public class BenchmarkTest00148 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar;
+
+ // Simple if statement that assigns param to bar on true condition
+ int num = 196;
+ if ((500 / 42) + num > 200) bar = param;
+ else bar = "This should never happen";
+
+ response.setHeader("X-XSS-Protection", "0");
+ Object[] obj = {"a", bar};
+ response.getWriter().format("Formatted like: %1$s and %2$s.", obj);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00149.java b/benchmarks/pairs/owasp/java/BenchmarkTest00149.java
new file mode 100644
index 0000000..329650d
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00149.java
@@ -0,0 +1,58 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00149")
+public class BenchmarkTest00149 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ StringBuilder sbxyz19132 = new StringBuilder(param);
+ String bar = sbxyz19132.append("_SafeStuff").toString();
+
+ response.setHeader("X-XSS-Protection", "0");
+ Object[] obj = {"a", bar};
+ response.getWriter().printf(java.util.Locale.US, "Formatted like: %1$s and %2$s.", obj);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00150.java b/benchmarks/pairs/owasp/java/BenchmarkTest00150.java
new file mode 100644
index 0000000..39baf14
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00150.java
@@ -0,0 +1,62 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00150")
+public class BenchmarkTest00150 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar;
+
+ // Simple if statement that assigns param to bar on true condition
+ int num = 196;
+ if ((500 / 42) + num > 200) bar = param;
+ else bar = "This should never happen";
+
+ response.setHeader("X-XSS-Protection", "0");
+ Object[] obj = {"a", bar};
+ response.getWriter().printf(java.util.Locale.US, "Formatted like: %1$s and %2$s.", obj);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00151.java b/benchmarks/pairs/owasp/java/BenchmarkTest00151.java
new file mode 100644
index 0000000..e530e70
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00151.java
@@ -0,0 +1,67 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00151")
+public class BenchmarkTest00151 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar = "alsosafe";
+ if (param != null) {
+ java.util.List This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00152")
+public class BenchmarkTest00152 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar;
+ String guess = "ABC";
+ char switchTarget = guess.charAt(2);
+
+ // Simple case statement that assigns param to bar on conditions 'A', 'C', or 'D'
+ switch (switchTarget) {
+ case 'A':
+ bar = param;
+ break;
+ case 'B':
+ bar = "bobs_your_uncle";
+ break;
+ case 'C':
+ case 'D':
+ bar = param;
+ break;
+ default:
+ bar = "bobs_your_uncle";
+ break;
+ }
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().println(bar.toCharArray());
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00153.java b/benchmarks/pairs/owasp/java/BenchmarkTest00153.java
new file mode 100644
index 0000000..8441088
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00153.java
@@ -0,0 +1,61 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00153")
+public class BenchmarkTest00153 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar = "safe!";
+ java.util.HashMap This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00154")
+public class BenchmarkTest00154 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar;
+ String guess = "ABC";
+ char switchTarget = guess.charAt(2);
+
+ // Simple case statement that assigns param to bar on conditions 'A', 'C', or 'D'
+ switch (switchTarget) {
+ case 'A':
+ bar = param;
+ break;
+ case 'B':
+ bar = "bobs_your_uncle";
+ break;
+ case 'C':
+ case 'D':
+ bar = param;
+ break;
+ default:
+ bar = "bobs_your_uncle";
+ break;
+ }
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().println(bar);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00155.java b/benchmarks/pairs/owasp/java/BenchmarkTest00155.java
new file mode 100644
index 0000000..f709a01
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00155.java
@@ -0,0 +1,58 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00155")
+public class BenchmarkTest00155 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ org.owasp.benchmark.helpers.ThingInterface thing =
+ org.owasp.benchmark.helpers.ThingFactory.createThing();
+ String bar = thing.doSomething(param);
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().println(bar);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00156.java b/benchmarks/pairs/owasp/java/BenchmarkTest00156.java
new file mode 100644
index 0000000..d6b2b74
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00156.java
@@ -0,0 +1,66 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00156")
+public class BenchmarkTest00156 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar = "";
+ if (param != null) {
+ java.util.List This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00157")
+public class BenchmarkTest00157 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ if (request.getHeader("Referer") != null) {
+ param = request.getHeader("Referer");
+ }
+
+ // URL Decode the header value since req.getHeader() doesn't. Unlike req.getParameter().
+ param = java.net.URLDecoder.decode(param, "UTF-8");
+
+ String bar;
+
+ // Simple ? condition that assigns param to bar on false condition
+ int num = 106;
+
+ bar = (7 * 42) - num > 200 ? "This should never happen" : param;
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().write(bar);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00276.java b/benchmarks/pairs/owasp/java/BenchmarkTest00276.java
new file mode 100644
index 0000000..b889dc4
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00276.java
@@ -0,0 +1,63 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00276")
+public class BenchmarkTest00276 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00278")
+public class BenchmarkTest00278 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00279")
+public class BenchmarkTest00279 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00280")
+public class BenchmarkTest00280 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00281")
+public class BenchmarkTest00281 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00282")
+public class BenchmarkTest00282 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00283")
+public class BenchmarkTest00283 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00284")
+public class BenchmarkTest00284 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00285")
+public class BenchmarkTest00285 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00286")
+public class BenchmarkTest00286 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00287")
+public class BenchmarkTest00287 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00288")
+public class BenchmarkTest00288 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00289")
+public class BenchmarkTest00289 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00290")
+public class BenchmarkTest00290 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00291")
+public class BenchmarkTest00291 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00292")
+public class BenchmarkTest00292 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00301")
+public class BenchmarkTest00301 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = "";
+ java.util.Enumeration This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00375")
+public class BenchmarkTest00375 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00375");
+ if (param == null) param = "";
+
+ String bar = "";
+ if (param != null) bar = param.split(" ")[0];
+
+ response.setHeader("X-XSS-Protection", "0");
+ Object[] obj = {"a", "b"};
+ response.getWriter().format(java.util.Locale.US, bar, obj);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00376.java b/benchmarks/pairs/owasp/java/BenchmarkTest00376.java
new file mode 100644
index 0000000..94b41e1
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00376.java
@@ -0,0 +1,57 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00376")
+public class BenchmarkTest00376 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00376");
+ if (param == null) param = "";
+
+ String bar;
+
+ // Simple ? condition that assigns param to bar on false condition
+ int num = 106;
+
+ bar = (7 * 42) - num > 200 ? "This should never happen" : param;
+
+ response.setHeader("X-XSS-Protection", "0");
+ Object[] obj = {"a", bar};
+ response.getWriter().format("Formatted like: %1$s and %2$s.", obj);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00377.java b/benchmarks/pairs/owasp/java/BenchmarkTest00377.java
new file mode 100644
index 0000000..75ce724
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00377.java
@@ -0,0 +1,62 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00377")
+public class BenchmarkTest00377 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00377");
+ if (param == null) param = "";
+
+ String bar = "alsosafe";
+ if (param != null) {
+ java.util.List This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00378")
+public class BenchmarkTest00378 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00378");
+ if (param == null) param = "";
+
+ StringBuilder sbxyz85125 = new StringBuilder(param);
+ String bar = sbxyz85125.append("_SafeStuff").toString();
+
+ response.setHeader("X-XSS-Protection", "0");
+ Object[] obj = {"a", "b"};
+ response.getWriter().format(bar, obj);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00379.java b/benchmarks/pairs/owasp/java/BenchmarkTest00379.java
new file mode 100644
index 0000000..b3279cd
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00379.java
@@ -0,0 +1,72 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00379")
+public class BenchmarkTest00379 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00379");
+ if (param == null) param = "";
+
+ // Chain a bunch of propagators in sequence
+ String a75704 = param; // assign
+ StringBuilder b75704 = new StringBuilder(a75704); // stick in stringbuilder
+ b75704.append(" SafeStuff"); // append some safe content
+ b75704.replace(
+ b75704.length() - "Chars".length(),
+ b75704.length(),
+ "Chars"); // replace some of the end content
+ java.util.HashMap This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00380")
+public class BenchmarkTest00380 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00380");
+ if (param == null) param = "";
+
+ String bar;
+ String guess = "ABC";
+ char switchTarget = guess.charAt(2);
+
+ // Simple case statement that assigns param to bar on conditions 'A', 'C', or 'D'
+ switch (switchTarget) {
+ case 'A':
+ bar = param;
+ break;
+ case 'B':
+ bar = "bobs_your_uncle";
+ break;
+ case 'C':
+ case 'D':
+ bar = param;
+ break;
+ default:
+ bar = "bobs_your_uncle";
+ break;
+ }
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().print(bar);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00381.java b/benchmarks/pairs/owasp/java/BenchmarkTest00381.java
new file mode 100644
index 0000000..5c365ac
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00381.java
@@ -0,0 +1,52 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00381")
+public class BenchmarkTest00381 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00381");
+ if (param == null) param = "";
+
+ String bar = org.owasp.esapi.ESAPI.encoder().encodeForHTML(param);
+
+ response.setHeader("X-XSS-Protection", "0");
+ Object[] obj = {"a", bar};
+ response.getWriter().printf(java.util.Locale.US, "Formatted like: %1$s and %2$s.", obj);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00382.java b/benchmarks/pairs/owasp/java/BenchmarkTest00382.java
new file mode 100644
index 0000000..e78fb70
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00382.java
@@ -0,0 +1,62 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00382")
+public class BenchmarkTest00382 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00382");
+ if (param == null) param = "";
+
+ String bar = "";
+ if (param != null) {
+ java.util.List This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00383")
+public class BenchmarkTest00383 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00383");
+ if (param == null) param = "";
+
+ // Chain a bunch of propagators in sequence
+ String a2196 = param; // assign
+ StringBuilder b2196 = new StringBuilder(a2196); // stick in stringbuilder
+ b2196.append(" SafeStuff"); // append some safe content
+ b2196.replace(
+ b2196.length() - "Chars".length(),
+ b2196.length(),
+ "Chars"); // replace some of the end content
+ java.util.HashMap This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00384")
+public class BenchmarkTest00384 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00384");
+ if (param == null) param = "";
+
+ org.owasp.benchmark.helpers.ThingInterface thing =
+ org.owasp.benchmark.helpers.ThingFactory.createThing();
+ String bar = thing.doSomething(param);
+
+ response.setHeader("X-XSS-Protection", "0");
+ Object[] obj = {"a", "b"};
+ response.getWriter().printf(java.util.Locale.US, bar, obj);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00385.java b/benchmarks/pairs/owasp/java/BenchmarkTest00385.java
new file mode 100644
index 0000000..0426889
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00385.java
@@ -0,0 +1,72 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00385")
+public class BenchmarkTest00385 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00385");
+ if (param == null) param = "";
+
+ // Chain a bunch of propagators in sequence
+ String a21475 = param; // assign
+ StringBuilder b21475 = new StringBuilder(a21475); // stick in stringbuilder
+ b21475.append(" SafeStuff"); // append some safe content
+ b21475.replace(
+ b21475.length() - "Chars".length(),
+ b21475.length(),
+ "Chars"); // replace some of the end content
+ java.util.HashMap This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00387")
+public class BenchmarkTest00387 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00387");
+ if (param == null) param = "";
+
+ String bar;
+
+ // Simple ? condition that assigns param to bar on false condition
+ int num = 106;
+
+ bar = (7 * 42) - num > 200 ? "This should never happen" : param;
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().println(bar.toCharArray());
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00388.java b/benchmarks/pairs/owasp/java/BenchmarkTest00388.java
new file mode 100644
index 0000000..b8bb389
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00388.java
@@ -0,0 +1,52 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00388")
+public class BenchmarkTest00388 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00388");
+ if (param == null) param = "";
+
+ StringBuilder sbxyz30382 = new StringBuilder(param);
+ String bar = sbxyz30382.append("_SafeStuff").toString();
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().println(bar.toCharArray());
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00389.java b/benchmarks/pairs/owasp/java/BenchmarkTest00389.java
new file mode 100644
index 0000000..7b99d89
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00389.java
@@ -0,0 +1,51 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00389")
+public class BenchmarkTest00389 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00389");
+ if (param == null) param = "";
+
+ String bar = org.apache.commons.lang.StringEscapeUtils.escapeHtml(param);
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().println(bar);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00390.java b/benchmarks/pairs/owasp/java/BenchmarkTest00390.java
new file mode 100644
index 0000000..ae95854
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00390.java
@@ -0,0 +1,58 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00390")
+public class BenchmarkTest00390 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00390");
+ if (param == null) param = "";
+
+ String bar = "";
+ if (param != null) {
+ bar =
+ new String(
+ org.apache.commons.codec.binary.Base64.decodeBase64(
+ org.apache.commons.codec.binary.Base64.encodeBase64(
+ param.getBytes())));
+ }
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().println(bar);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00391.java b/benchmarks/pairs/owasp/java/BenchmarkTest00391.java
new file mode 100644
index 0000000..6fea39c
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00391.java
@@ -0,0 +1,51 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00391")
+public class BenchmarkTest00391 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00391");
+ if (param == null) param = "";
+
+ String bar = org.owasp.esapi.ESAPI.encoder().encodeForHTML(param);
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().println(bar);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00392.java b/benchmarks/pairs/owasp/java/BenchmarkTest00392.java
new file mode 100644
index 0000000..43a3394
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00392.java
@@ -0,0 +1,59 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00392")
+public class BenchmarkTest00392 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00392");
+ if (param == null) param = "";
+
+ String bar = param;
+ if (param != null && param.length() > 1) {
+ StringBuilder sbxyz38384 = new StringBuilder(param);
+ bar = sbxyz38384.replace(param.length() - "Z".length(), param.length(), "Z").toString();
+ }
+
+ response.setHeader("X-XSS-Protection", "0");
+ int length = 1;
+ if (bar != null) {
+ length = bar.length();
+ response.getWriter().write(bar.toCharArray(), 0, length);
+ }
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00393.java b/benchmarks/pairs/owasp/java/BenchmarkTest00393.java
new file mode 100644
index 0000000..f16359f
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00393.java
@@ -0,0 +1,56 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00393")
+public class BenchmarkTest00393 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00393");
+ if (param == null) param = "";
+
+ String bar;
+
+ // Simple ? condition that assigns constant to bar on true condition
+ int num = 106;
+
+ bar = (7 * 18) + num > 200 ? "This_should_always_happen" : param;
+
+ response.setHeader("X-XSS-Protection", "0");
+ response.getWriter().write(bar);
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00395.java b/benchmarks/pairs/owasp/java/BenchmarkTest00395.java
new file mode 100644
index 0000000..6fcc651
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00395.java
@@ -0,0 +1,56 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00395")
+public class BenchmarkTest00395 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ String param = request.getParameter("BenchmarkTest00395");
+ if (param == null) param = "";
+
+ String bar = "";
+ if (param != null) bar = param.split(" ")[0];
+
+ response.setHeader("X-XSS-Protection", "0");
+ int length = 1;
+ if (bar != null) {
+ length = bar.length();
+ response.getWriter().write(bar, 0, length);
+ }
+ }
+}
diff --git a/benchmarks/pairs/owasp/java/BenchmarkTest00467.java b/benchmarks/pairs/owasp/java/BenchmarkTest00467.java
new file mode 100644
index 0000000..de85fdc
--- /dev/null
+++ b/benchmarks/pairs/owasp/java/BenchmarkTest00467.java
@@ -0,0 +1,61 @@
+/**
+ * OWASP Benchmark Project v1.2
+ *
+ * This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00467")
+public class BenchmarkTest00467 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ java.util.Map This file is part of the Open Web Application Security Project (OWASP) Benchmark Project. For
+ * details, please see https://owasp.org/www-project-benchmark/.
+ *
+ * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, version 2.
+ *
+ * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * @author Nick Sanidas
+ * @created 2015
+ */
+package org.owasp.benchmark.testcode;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(value = "/xss-00/BenchmarkTest00468")
+public class BenchmarkTest00468 extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+
+ java.util.Map