public class XSSUrlParamSecurityAdapter extends WhiteBlackExpressionSecurityAdapter
Modifier and Type | Field and Description |
---|---|
static String |
BLACK_URL_REGEX_PROP |
static String |
WHITE_URL_REGEX_PROP |
blackRegExPattern, whiteRegExPattern
REGEX_PROP_FILE
Constructor and Description |
---|
XSSUrlParamSecurityAdapter() |
Modifier and Type | Method and Description |
---|---|
Data<String> |
preProcess(Data<String> input)
For Absolute URL's we can determine the genuine host name (or pick from config) and sanitize those out from the input.
|
protected void |
processInvalidQuery(Data<String> input) |
Data |
sanitize(Data<String> input)
Sanitize content, from malicious to harmless.
|
void |
validate(Data<String> input)
Check if the input is safe or not
When used in a chained or a SecurityContext with other SecurityAdapter s then the Adapters throwing
a OperationNotSupportedException will be ignored. |
getBlackRegExPattern, getWhiteRegExPattern, processNameValue, processParams, setBlackRegExPattern, setWhiteRegExPattern, validateAgainstBlackRegEx, validateAgainstWhiteRegEx
public static final String BLACK_URL_REGEX_PROP
public static final String WHITE_URL_REGEX_PROP
public XSSUrlParamSecurityAdapter() throws IOException
IOException
public Data sanitize(Data<String> input) throws org.owasp.validator.html.ScanException, org.owasp.validator.html.PolicyException, OperationNotSupportedException
SecurityAdapter
OperationNotSupportedException
.
When used in a chained or a SecurityContext
with other SecurityAdapter
s then the Adapters throwing
a OperationNotSupportedException
will be ignored. Any other exception will be thrown if there is
an issue in the executionof the sanitization process.sanitize
in interface SecurityAdapter<String>
sanitize
in class WhiteBlackExpressionSecurityAdapter
org.owasp.validator.html.ScanException
org.owasp.validator.html.PolicyException
OperationNotSupportedException
public Data<String> preProcess(Data<String> input)
input
- @Nullablepublic void validate(Data<String> input) throws SecurityException, IOException
SecurityAdapter
SecurityContext
with other SecurityAdapter
s then the Adapters throwing
a OperationNotSupportedException
will be ignored.validate
in interface SecurityAdapter<String>
validate
in class WhiteBlackExpressionSecurityAdapter
input
- as Data
SecurityException
- is its is not safe. This is to provide additional details about the failure that te return param cannot.IOException
- for any type of setup, reading, infra related issue with files/configsprotected void processInvalidQuery(Data<String> input) throws SecurityException, IOException
processInvalidQuery
in class WhiteBlackExpressionSecurityAdapter
SecurityException
IOException
Copyright © 2018. All rights reserved.