-
Notifications
You must be signed in to change notification settings - Fork 36
Add fuzz testing for query parser and token validator #150
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
base: main
Are you sure you want to change the base?
Conversation
Implements cargo-fuzz based fuzzing for security-critical components: - Query parser (URL and path-based request parsing) - Token validator (SSRF token validation and file:// handling) Changes: - Add fuzz/ directory with two fuzz targets - Add GitHub Actions workflow to run fuzz tests on PRs (2 min per target) - Expose internal types via lib.rs for fuzzing - Add fuzz/README.md with usage instructions - Update main README with fuzz testing section The fuzz tests run automatically on every PR to catch parsing vulnerabilities, edge cases, and potential crashes before they reach production.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #150 +/- ##
=======================================
Coverage 91.88% 91.88%
=======================================
Files 14 14
Lines 2404 2404
Branches 2404 2404
=======================================
Hits 2209 2209
Misses 147 147
Partials 48 48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| workflow_dispatch: | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intent behind this? Don't Actions runners have colors enabled by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CARGO_TERM_COLOR: always setting forces Cargo to always output colored text, even when it detects it's not running in an interactive terminal. I don't think GitHub Actions runners have colors enabled by default. Without this setting, we'd see plain text output. With it, we get syntax-highlighted errors, warnings, and other Cargo messages that are easier to parse visually when reviewing CI logs.
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Install Rust nightly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo-fuzz requires the nightly version of Rust. Let's also update other places where the agent is built to use nightly for consistency (different PR).
ThirdEyeSqueegee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broadly LGTM. Posted an action item in a comment on fuzz.yml
Issue #, if available:
Description of changes:
Implements cargo-fuzz based fuzzing for security-critical components:
Changes:
The fuzz tests run automatically on every PR to catch parsing vulnerabilities, edge cases, and potential crashes before they reach production.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.