Uh oh!
There was an error while loading. Please reload this page.
Rust: Add core::fmt::Write models - #22390
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Rust taint-flow models for formatted writes into output buffers.
Changes:
- Models
core::fmt::Writemethods andcore::fmt::write. - Expands legacy format-macro flow tests.
- Adds a change note.
Show a summary per file
| File | Description |
|---|---|
rust/ql/lib/codeql/rust/frameworks/stdlib/core.model.yml | Adds formatting flow summaries. |
rust/ql/test/library-tests/format-macros-legacy/main.rs | Adds formatted-write flow cases. |
rust/ql/test/library-tests/format-macros-legacy/inline-taint-flow.expected | Updates flow expectations. |
rust/ql/test/library-tests/format-macros-legacy/FormatArgs.expected | Updates format-argument expectations. |
rust/ql/test/library-tests/format-macros-legacy/LogInjection.expected | Updates shifted result locations. |
rust/ql/lib/change-notes/2026-08-19-rust-core-fmt-flow-models.md | Documents the analysis improvement. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Balanced
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| # Fmt | ||
| - ["<_ as core::fmt::Write>::write_fmt", "Argument[0]", "Argument[self].Reference", "taint", "manual"] | ||
| - ["<_ as core::fmt::Write>::write_str", "Argument[0].Reference", "Argument[self].Reference", "taint", "manual"] | ||
| - ["<_ as core::fmt::Write>::write_char", "Argument[0]", "Argument[self].Reference", "taint", "manual"] |
There was a problem hiding this comment.
This will have a semantic merge conflict with #22376.
There was a problem hiding this comment.
yeah, was about to comment the same. #22376 was merged, so we need to update this with s/<_ as core::fmt::Write>/core::fmt::Write/g
There was a problem hiding this comment.
I've updated the models (I had to merge in a newer version of the parent to get a new enough version of main for them to work; hopefully this won't cause issues merging this PR into the parent).
Uh oh!
There was an error while loading. Please reload this page.
geoffw0
commented
Aug 24, 2026
Comments addressed. DCA looks fine (if unexciting). CI is failing now, it doesn't look like something we've caused here, probably brought in with the merge. |
geoffw0
commented
Aug 26, 2026
Branch updated, I think this is ready to merge into the parent. |
deafc1b
into
github:redsun82-rust-analyzer-updateUh oh!
There was an error while loading. Please reload this page.
Add models for
core::fmt::Write, which is having a larger effect on taint analysis following recent changes. For #22346.@redsun82