...
Code Block | ||
---|---|---|
| ||
// String s may be user controllable // \uFE64 is normalized to << and \uFE64 is normalized to >> using KFKC String s = ""\uFE64"" + "script""script" + ""\uFE65"";; //validate Pattern pattern = Pattern.compile("[<>]""[<>]"); // check for angle brackets Matcher matcher = pattern.matcher(s); if(matcher.find()) { System.out.println(""found black listed tag""); } else { // ... } // normalize s = Normalizer.normalize(s, Form.NFKC); |
...
Code Block | ||
---|---|---|
| ||
String s = ""\uFE64"" + "script""script" + ""\uFE65""; // normalize s = Normalizer.normalize(s, Form.NFKC); //validate Pattern pattern = Pattern.compile("[<>]""[<>]"); Matcher matcher = pattern.matcher(s); if(matcher.find()) { System.out.println(""found black listed tag""); throw new IllegalStateException(); } else { // ... } |
...
Wiki Markup |
---|
\[[API 06|AA. Java References#API 06]\] \[[Unicode 08|AA. Java References#Unicode 08]\] \[[Weber 09|AA. Java References#Weber 09]\] \[[MITRE 09|AA. Java References#MITRE 09]\] [CWE ID 289|http://cwe.mitre.org/data/definitions/289.html] ""Authentication Bypass by Alternate Name"" and [CWE ID 180|http://cwe.mitre.org/data/definitions/289.html] ""Incorrect Behavior Order: Validate Before Canonicalize"" |
...
IDS09-J. Account for supplementary and combining characters in globalized code 10. Input Validation and Data Sanitization (IDS) IDS11-J. Do not delete non-character code points