Rust: Fill some gaps in our database models.#20208
Merged
geoffw0 merged 10 commits intogithub:mainfrom Aug 13, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fills gaps in database security models for Rust by adding missing SQL injection sinks and database source models across multiple database frameworks. The changes enhance security analysis capabilities by ensuring comprehensive coverage of database operations.
- Adds missing SQL injection sink models for previously uncovered database methods
- Adds database source models for data retrieval operations that were not tracked
- Includes test cases to validate the new security models
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/ql/test/library-tests/frameworks/rusqlite/main.rs | Adds test cases for new rusqlite security models |
| rust/ql/test/library-tests/frameworks/postgres/main.rs | Adds test cases for postgres security models including SimpleQueryRow |
| rust/ql/lib/codeql/rust/frameworks/tokio-postgres.model.yml | Adds query_one sink and SimpleQueryRow source models |
| rust/ql/lib/codeql/rust/frameworks/sqlx.model.yml | Adds Row source models for data retrieval methods |
| rust/ql/lib/codeql/rust/frameworks/rusqlite.model.yml | Fixes syntax error and adds prepare_cached sink model |
| rust/ql/lib/codeql/rust/frameworks/postgres.model.yml | Adds simple_query sink and Row/SimpleQueryRow source models |
Contributor
Author
|
DCA LGTM. |
hvitved
approved these changes
Aug 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fill in some gaps in our models of database sources and sinks.
Only partially tested, as these models are quite similar to existing models and to each other. I've also done some local testing and will do a DCA run in case of any surprises.