-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add test coverage for actix-web, poem, and http-types cookie secure attribute #20749
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
Changes from all commits
2497d8c
8f02ab1
ee3d57e
7fe4877
55cf375
e5933d0
21274d3
7383e4f
5fed5a2
ff06181
99a3692
ad24b74
6e35cb9
e780187
1e7acc5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| category: minorAnalysis | ||
| --- | ||
| * Added models for cookie methods in the `poem` crate. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| extensions: | ||
| - addsTo: | ||
| pack: codeql/rust-all | ||
| extensible: sinkModel | ||
| data: | ||
| - ["<poem::web::cookie::CookieJar>::add", "Argument[0]", "cookie-use", "manual"] | ||
| - ["<poem::web::cookie::SignedCookieJar>::add", "Argument[0]", "cookie-use", "manual"] | ||
| - ["<poem::web::cookie::PrivateCookieJar>::add", "Argument[0]", "cookie-use", "manual"] | ||
| - ["<poem::session::server_session::ServerSession>::new", "Argument[0]", "cookie-use", "manual"] | ||
| - addsTo: | ||
| pack: codeql/rust-all | ||
| extensible: summaryModel | ||
| data: | ||
| - ["<poem::web::cookie::Cookie>::set_secure", "Argument[self].OptionalBarrier[cookie-secure-arg0]", "Argument[self]", "taint", "manual"] | ||
| - ["<poem::session::cookie_config::CookieConfig>::secure", "Argument[self].OptionalBarrier[cookie-secure-arg0]", "ReturnValue", "taint", "manual"] | ||
| - ["<poem::session::cookie_config::CookieConfig>::partitioned", "Argument[self].OptionalBarrier[cookie-partitioned-arg0]", "ReturnValue", "taint", "manual"] | ||
| - ["<poem::session::cookie_config::CookieConfig>::name", "Argument[self]", "ReturnValue", "taint", "manual"] | ||
| - ["<poem::session::cookie_config::CookieConfig>::path", "Argument[self]", "ReturnValue", "taint", "manual"] | ||
| - ["<poem::session::cookie_config::CookieConfig>::domain", "Argument[self]", "ReturnValue", "taint", "manual"] | ||
| - ["<poem::session::cookie_config::CookieConfig>::http_only", "Argument[self]", "ReturnValue", "taint", "manual"] | ||
| - ["<poem::session::cookie_config::CookieConfig>::same_site", "Argument[self]", "ReturnValue", "taint", "manual"] | ||
| - ["<poem::session::cookie_config::CookieConfig>::max_age", "Argument[self]", "ReturnValue", "taint", "manual"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,9 +39,9 @@ module InsecureCookieConfig implements DataFlow::ConfigSig { | |
| node instanceof Sink | ||
| } | ||
|
|
||
| predicate isBarrier(DataFlow::Node node) { | ||
| // setting the 'secure' attribute to true | ||
| cookieSetNode(node, "secure", true) | ||
| predicate isBarrierIn(DataFlow::Node node) { | ||
| // setting the 'secure' attribute | ||
geoffw0 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| cookieSetNode(node, "secure", _) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change because setting a cookie's security to What is the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's about preventing excessive flows in a case such as this: Making line 2 a barrier prevents flow from line 1 to 3, leaving us with just the shorter path from line 2 to 3. It's a fairly common pattern to make sources in-barriers, e.g. you'll see this in all of the The reason I've changed it to an in barrier is simple - if I didn't, then flow from every source would be blocked immediately by that source itself being a barrier. As an in-barrier, the situation becomes something like this: |
||
| or | ||
| node instanceof Barrier | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.