File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
python/ql/lib/semmle/python Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -1268,19 +1268,16 @@ module Http {
12681268 * Holds if the `HttpOnly` flag of the cookie is known to have a value of `b`.
12691269 */
12701270 predicate hasHttpOnlyFlag ( boolean b ) {
1271- exists ( this .getHeaderArg ( ) ) and
1272- (
1273- exists ( StringLiteral sl |
1274- sl .getText ( ) .regexpMatch ( "(?i).*;\\s*httponly(;.*|\\s*)" ) and
1275- TaintTracking:: localTaint ( DataFlow:: exprNode ( sl ) , this .getHeaderArg ( ) ) and
1276- b = true
1277- )
1271+ exists ( StringLiteral sl |
1272+ // `sl` is likely a substring of the header
1273+ TaintTracking:: localTaint ( DataFlow:: exprNode ( sl ) , this .getHeaderArg ( ) ) and
1274+ sl .getText ( ) .regexpMatch ( "(?i).*;\\s*httponly(;.*|\\s*)" ) and
1275+ b = true
12781276 or
1279- exists ( StringLiteral sl |
1280- not sl .getText ( ) .regexpMatch ( "(?i).*;\\s*httponly(;.*|\\s*)" ) and
1281- DataFlow:: localFlow ( DataFlow:: exprNode ( sl ) , this .getHeaderArg ( ) ) and
1282- b = false
1283- )
1277+ // `sl` is the entire header
1278+ DataFlow:: localFlow ( DataFlow:: exprNode ( sl ) , this .getHeaderArg ( ) ) and
1279+ not sl .getText ( ) .regexpMatch ( "(?i).*;\\s*httponly(;.*|\\s*)" ) and
1280+ b = false
12841281 )
12851282 }
12861283
You can’t perform that action at this time.
0 commit comments