You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CodeQL fails to detect rust/insecure-cookie in Rust code #3915
I tried to replicate, but it works fine on my end (on macOS). Here is the cargo.toml file I use
[package]
name = "cookie-test"
version = "0.1.0"
edition = "2024"
[dependencies]
cookie = { version = "0.18.1", features = ["percent-encode", "signed", "private"] }
biscotti = { version = "0.4.3" }
actix-web = { version = "4", features = ["cookies"] }
poem = { version = "3", features = ["cookie", "session"] }
http-types = { version = "2", features = ["cookies"] }
and the main.rs file:
use cookie::Cookie;fnmain(){println!("Hello, world!");// BAD: creating a cookie without specifying the `secure` attributelet cookie = Cookie::build(("session","abcd1234")).build();letmut jar = cookie::CookieJar::new();
jar.add(cookie.clone());}
Which version of Rust/cargo are you using, and in which environment?
use cookie::Cookie;fnmain(){let cookie = Cookie::build(("session","abcd1234")).build();letmut jar = cookie::CookieJar::new();
jar.add(cookie.clone());}
My local environment: macOS Tahoe 26.4.1 arm64
But the same behavior reproduces in GitHub Actions ubuntu envrironment
Just tested once again:
$ codeql database create --build-mode=none --language=rust .codeql-db
Initializing database at.......
$ codeql database analyze --format=sarifv2.1.0 --output=codeql.sarif .codeql-db
Running queries....
................
| Metric | Value |
+--------------------------------------------------------------+-------+
| Total number of Rust files that were extracted with errors | 0 |
| Total number of Rust files that were extracted without error | 1 |
$ jq '.runs[].results' codeql.sarif
[]
Activity
hvitved commentedon May 19, 2026
Hi 👋
I tried to replicate, but it works fine on my end (on macOS). Here is the
cargo.tomlfile I useand the
main.rsfile:Which version of Rust/cargo are you using, and in which environment?
fabasoad commentedon May 19, 2026
Hey! Thank you for looking into this. Here is the information you asked:
cargo.tomlmain.rsMy local environment: macOS Tahoe 26.4.1 arm64
But the same behavior reproduces in GitHub Actions ubuntu envrironment
Just tested once again:
hvitved commentedon May 21, 2026
Thanks. I believe this is a (known) issue with Rust 1.95.0; as a workaround, if you use 1.94.0, things should work again.
fabasoad commentedon May 22, 2026
@hvitved Thanks for the reply! Do you have an estimate for when it will be fixed for Rust 1.95.0?
hvitved commentedon May 26, 2026
It should be fixed as soon as github/codeql#21714 is merged; not sure about the timeline, but I would hope it gets included with the next release.
fabasoad commentedon May 26, 2026
Thank you. Subscribed.