Skip to content

Instantly share code, notes, and snippets.

@jolor1
Last active May 4, 2021 14:03
Show Gist options
  • Save jolor1/1d468cacb3f8c8c45e795528d606c359 to your computer and use it in GitHub Desktop.
Save jolor1/1d468cacb3f8c8c45e795528d606c359 to your computer and use it in GitHub Desktop.
public static void fuzzerTestOneInput(FuzzedDataProvider data) {
String input = data.consumeRemainingAsString();
String safeJson;
try {
safeJson = JsonSanitizer.sanitize(input, 10);
} catch (Exeption e) {
return;
}
assert !safeJson.contains("</script")
: new FuzzerSecurityIssueHigh("Output contains </script");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment