Python: Split Insecure Cookie query into multiple queries #20494
Python: Split Insecure Cookie query into multiple queries #20494joefarebrother merged 13 commits intogithub:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR splits the existing py/insecure-cookie query into three separate, more focused queries to better align with JavaScript's cookie security query structure. The original query checked for multiple cookie security attributes in a single query, while the new approach separates concerns into distinct queries.
- Refactors
py/insecure-cookieto only check for missingSecureattribute - Creates new
py/client-exposed-cookiequery for missingHttpOnlyattribute - Creates new
py/samesite-none-cookiequery forSameSite=Noneattribute issues
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
python/ql/src/Security/CWE-614/InsecureCookie.ql |
Simplified to only check for missing Secure attribute |
python/ql/src/Security/CWE-1004/NonHttpOnlyCookie.ql |
New query for missing HttpOnly attribute |
python/ql/src/Security/CWE-1275/SameSiteNoneCookie.ql |
New query for SameSite=None issues |
python/ql/test/query-tests/Security/CWE-614-InsecureCookie/test.py |
Updated test with inline expectations for new query behavior |
python/ql/src/change-notes/2025-09-19-insecure-cookie.md |
Documents the query split changes |
Comments suppressed due to low confidence (2)
|
QHelp previews: python/ql/src/Security/CWE-1004/NonHttpOnlyCookie.qhelpSensitive cookie missing
|
tausbn
left a comment
There was a problem hiding this comment.
Looks good to me! The added documentation is especially nice. 👍
Splits the
py/insecure-cookiequery intopy/insecure-cookie,py/client-exposed-cookie, andpy/samesite-none-cookie.This is closer to how these queries are handled in JS with
js/clear-text-cookie,js/client-exposed-cookie, andjs/samesite-none-cookiequeries.