Fuzzing, property tests, CLI split, and 1.1.0 #2

Merged
lucasrguerra merged 4 commits from feat/robustez into main 2026-11-03 14:38:10 +00:00
Owner

What

  • Bug found by fuzzing (security): a TLS certificate with a multi-byte UTF-8 character in its validity time crashed parse_x509_der_not_after (a byte-offset slice landed inside the character), letting a hostile host in scope abort its sweep. Non-ASCII times are now an error, with a regression test.
  • Property tests: every parser of untrusted input must never panic (certificates, banners, HTTP, NVD/KEV, CPE, targets, cron). They also cover CIDR and range arithmetic, and the diff engine's guarantees: no removal from a partial or aborted sweep, no port closed without being scanned, disappearance exactly at the threshold, determinism, and assets outside the scope left intact.
  • fuzz/: four cargo-fuzz targets. The new Weekly workflow runs cargo audit independently of pushes and 10 minutes of fuzzing per target, with a persistent corpus.
  • Refactor: main.rs (1,900 lines) split into server/ (api, export, assets), scanner, feeds_cmd, config_cmd and commands. The code was moved without changes.
  • Version: 1.1.0.

Verified

  • scripts/check.sh --full passes.
  • The regression and the reinforced proptest fail without the fix and pass with it.
  • cargo fuzz: 25M executions on der_certificate after the fix, plus about 40s on each of the other targets, with no crashes.

🤖 Generated with Claude Code

## What - **Bug found by fuzzing (security):** a TLS certificate with a multi-byte UTF-8 character in its validity time crashed `parse_x509_der_not_after` (a byte-offset slice landed inside the character), letting a hostile host in scope abort its sweep. Non-ASCII times are now an error, with a regression test. - **Property tests:** every parser of untrusted input must never panic (certificates, banners, HTTP, NVD/KEV, CPE, targets, cron). They also cover CIDR and range arithmetic, and the diff engine's guarantees: no removal from a partial or aborted sweep, no port closed without being scanned, disappearance exactly at the threshold, determinism, and assets outside the scope left intact. - **`fuzz/`:** four cargo-fuzz targets. The new `Weekly` workflow runs `cargo audit` independently of pushes and 10 minutes of fuzzing per target, with a persistent corpus. - **Refactor:** `main.rs` (1,900 lines) split into `server/` (api, export, assets), `scanner`, `feeds_cmd`, `config_cmd` and `commands`. The code was moved without changes. - **Version:** 1.1.0. ## Verified - `scripts/check.sh --full` passes. - The regression and the reinforced proptest **fail without the fix** and pass with it. - `cargo fuzz`: 25M executions on `der_certificate` after the fix, plus about 40s on each of the other targets, with no crashes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lucasrguerra added 4 commits 2026-11-03 13:53:44 +00:00
parse_asn1_time_string sliced the time by byte offset, so a multi-byte
UTF-8 character in a hostile certificate put a boundary inside it and
panicked, aborting the sweep. Found by cargo fuzz.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every parser of data Xexéu does not control must return an error, never
panic; the diff engine's guarantees (no removal from a partial sweep, no
closed port that was not scanned, disappearance exactly at the threshold)
are now properties. The Weekly workflow runs cargo audit independently of
pushes and fuzzes each target on a persistent corpus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
server/ (state, ingestion, API, CSV exports, embedded assets), scanner,
feeds_cmd, config_cmd and commands. Code moved as is; no behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore(release): 1.1.0
CI / Format and clippy (pull_request) Successful in 30s
CI / Tests (Linux) (pull_request) Successful in 2m39s
CI / Dependency audit (pull_request) Successful in 15s
CI / Docker image (build and smoke test) (pull_request) Successful in 6m37s
8b6e0d4a3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lucasrguerra merged commit d8b8ff1150 into main 2026-11-03 14:38:10 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ciberfauna/harpia#2