Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential vulnerabilities are being hidden with concatenation #86

Open
carlnewton opened this issue May 21, 2021 · 0 comments
Open

Potential vulnerabilities are being hidden with concatenation #86

carlnewton opened this issue May 21, 2021 · 0 comments

Comments

@carlnewton
Copy link

Variables, constants and function calls are not included in the report if concatenated with something which has already been included. Is there any way to override this behaviour other than adding the safe constant to getXSSMitigationFunctions?

echo SAFE_CONSTANT . vulnerableFunction();
// Warning: Possible XSS detected with SAFE_CONSTANT on echo

When reviewing the report, it can give the impression that an issue is safe when it is not.

Here are some examples from a quick test:

/**
 * Warning: Possible XSS detected with CONSTANT on echo
 * Warning: Possible XSS detected with $var on echo
 */
echo CONSTANT; echo $var;

/**
 * Warning: Possible XSS detected with CONSTANT on echo
 */
echo CONSTANT . $var;

/**
 * Error: Easy XSS detected because of direct user input with $_GET on echo
 * Error: Easy XSS detected because of direct user input with $_GET on echo
 */
echo $_GET['one'] . $_GET['two'];

/**
 * Warning: Possible XSS detected with $varOne on echo
 */
echo $varOne . $varTwo;

/**
 * Warning: Possible XSS detected with SAFE_CONSTANT on echo
 */
echo SAFE_CONSTANT . vulnerableFunction();

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant