Skip to content
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

Rust: Value flow and taint flow through formatting strings #18394

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

paldepind
Copy link
Contributor

@paldepind paldepind commented Jan 3, 2025

This PR adds:

  • Value flow through macro calls.
  • Taint flow from arguments (including those in format strings) to format_args! to the format_args! expression itself.
  • Adds to models for stdlib functions used in format!.

The original goal was to get taint through the format! macro. But since its definition uses a let statement, the issue in #18330 prevents that from working. But once that is fixed, the changes here should give flow through fomat!.

MacroCalls are now included in the CFG in post-order. Previously they where skipped over and not included in the CFG, but this caused the getMacroCall predicate on MacroExprCfgNode to never have any results. Including them in the CFG fixes that, and I don't think there's any reason to exclude them.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jan 3, 2025
@paldepind paldepind marked this pull request as ready for review January 3, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant