More Feedback integration

This commit is contained in:
Francis Alexander
2021-01-26 17:24:17 +05:30
parent 985d3d469a
commit 19872e9aed
3 changed files with 6 additions and 6 deletions

View File

@@ -48,7 +48,7 @@
the <code>Access-Control-Allow-Origin</code> header when the
<code>Access-Control-Allow-Credentials</code> header value is
<code>true</code>.This can be done using a sandboxed iframe. A more detailed
explanation is available in the portswigger blogpost.
explanation is available in the portswigger blogpost referenced below.
</p>
</recommendation>

View File

@@ -19,6 +19,10 @@ import DataFlow::PathGraph
* Holds if `header` sets `Access-Control-Allow-Credentials` to `true`. This ensures fair chances of exploitability.
*/
private predicate setsAllowCredentials(MethodAccess header) {
(
header.getMethod() instanceof ResponseSetHeaderMethod or
header.getMethod() instanceof ResponseAddHeaderMethod
) and
header.getArgument(0).(CompileTimeConstantExpr).getStringValue().toLowerCase() =
"access-control-allow-credentials" and
header.getArgument(1).(CompileTimeConstantExpr).getStringValue() = "true"
@@ -39,10 +43,6 @@ class CorsOriginConfig extends TaintTracking::Configuration {
corsheader.getMethod() instanceof ResponseSetHeaderMethod or
corsheader.getMethod() instanceof ResponseAddHeaderMethod
) and
(
allowcredentialsheader.getMethod() instanceof ResponseSetHeaderMethod or
allowcredentialsheader.getMethod() instanceof ResponseAddHeaderMethod
) and
getAccessControlAllowOriginHeaderName() = corsheader.getArgument(0) and
setsAllowCredentials(allowcredentialsheader) and
corsheader.getEnclosingCallable() = allowcredentialsheader.getEnclosingCallable() and

View File

@@ -2,6 +2,6 @@ package org.apache.commons.lang3;
public class StringUtils {
public static boolean isEmpty(final CharSequence cs) {
return cs == null || cs.length() == 0;
return true;
}
}