1 package com.trendmicro.grid.acl.l0;
2
3 import com.trendmicro.grid.acl.RestService;
4
5
6
7
8
9
10
11 public interface Level0RestService extends RestService {
12
13
14
15 public final class RestUtil {
16
17
18
19 public static final String[] CROSS_SITE_SCRIPTING_TAGS = System.getProperty(
20 "gacl.crosssite.scripting.taglist",
21 "<html|<object|<embed|<video|<source|<article|<svg|<script|<frame|<iframe").split("\\|");
22
23 private RestUtil() {
24 }
25
26
27
28
29
30
31
32 public static void assertIsNotCrossSiteScriptingVulnerable(String input) {
33 if (input != null) {
34 input = input.toLowerCase();
35 for (String tag : CROSS_SITE_SCRIPTING_TAGS) {
36 if (input.contains(tag)) {
37 throw new IllegalArgumentException("The value '" + tag.substring(1) +
38 "' is not allowed in the given request.");
39 }
40 }
41 }
42 }
43 }
44 }