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 {
1268
1268
* Holds if the `HttpOnly` flag of the cookie is known to have a value of `b`.
1269
1269
*/
1270
1270
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
1278
1276
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
1284
1281
)
1285
1282
}
1286
1283
You can’t perform that action at this time.
0 commit comments