test: property tests and fuzz targets for untrusted input and the diff engine

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>
This commit is contained in:
Lucas RayanandClaude Opus 5.5 committed 2026-11-03 10:53:26 -03:00
1 parent 0d4fe01baf
commit b70f36da09
16 files changed
+2918 -4

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
#![no_main]
//! TLS certificates come from any host in scope.
use libfuzzer_sys::fuzz_target;
use xexeu_core::vuln::checks::parse_x509_der_not_after;
fuzz_target!(|der: &[u8]| {
let _ = parse_x509_der_not_after(der);
});
+15
View File
@@ -0,0 +1,15 @@
#![no_main]
//! Targets, exclusions, scope entries and cron come from the config file and
//! from the dashboard's group form.
use libfuzzer_sys::fuzz_target;
use xexeu_core::schedule::{CronSpec, Jitter};
use xexeu_core::targets::{parse_exclusion, parse_scope_entry, parse_target};
fuzz_target!(|text: &str| {
let _ = parse_target(text);
let _ = parse_exclusion(text);
let _ = parse_scope_entry(text);
let _ = CronSpec::parse(text);
let _ = Jitter::parse(text);
});
+13
View File
@@ -0,0 +1,13 @@
#![no_main]
//! Banners and HTTP responses come from any host in scope.
use libfuzzer_sys::fuzz_target;
use xexeu_core::scan::fingerprint::extract_server_header;
use xexeu_core::vuln::checks::evaluate_http_admin_response;
use xexeu_core::vuln::matcher::parse_banner_to_cpe;
fuzz_target!(|text: &str| {
let _ = parse_banner_to_cpe(text);
let _ = extract_server_header(text);
let _ = evaluate_http_admin_response(8080, text);
});
+15
View File
@@ -0,0 +1,15 @@
#![no_main]
//! NVD and KEV feeds are downloaded or imported from files.
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use xexeu_core::vuln::feeds::{parse_kev_reader, parse_nvd_json, Cpe};
fuzz_target!(|data: &[u8]| {
let _ = parse_nvd_json(Cursor::new(data));
let _ = parse_kev_reader(Cursor::new(data));
if let Ok(text) = std::str::from_utf8(data) {
let _ = Cpe::parse(text);
}
});