Repository navigation
ci(fuzz): keep failing inputs out of public logs and artifacts - #864
Conversation
A fork inherits the daily schedule but not the ExtendDB runner group, so in a fork that enables Actions the schedule queues six jobs for a runner label that the fork does not have. The job now runs only when the repository owner is ExtendDB. The runner group belongs to the organization, so the check reads the repository owner. A pull request from a fork still runs, because its workflow runs in the base repository. The root .cargo/config.toml sets the resolver that cargo metadata uses when the workflow builds fuzz/Cargo.lock, so the pull_request paths now include .cargo/.
The log and the artifacts of a workflow run in a public repository are public. When an input crashed, timed out or ran out of memory, the workflow uploaded it as an artifact, libFuzzer printed it in the log as bytes and as base64 when it was 256 bytes or less, and cargo-fuzz printed it in full. libFuzzer also wrote an input that ran for more than 10 seconds, and printed it under the same size limit, on a run that passed. The SigV4 targets parse a request before the caller is authenticated, so such an input can be a denial of service that SECURITY.md asks to be reported privately. The Fuzz step now writes the cargo-fuzz and libFuzzer output to a file under $RUNNER_TEMP and prints only the final statistics of a clean run. It fails with a fixed message when libFuzzer exits with an error or leaves any file under fuzz/artifacts, so a slow input fails the job too. The upload step is removed. A new Build step runs cargo fuzz build before the Fuzz step, so build errors stay in the log. Tests: a local run of the step script printed only the statistics for a clean run. With an out-of-memory failure it printed only the error line, and the lines that print the input stayed in the log file.
validate_timestamp reads one header, x-amz-date. The target built up to three arbitrary headers before it, so part of each input went to header names and values that validate_timestamp does not read. The whole input is now the x-amz-date value. build_header_map, which only this target used, is removed. The two seeds lose the leading byte that set the header count to zero. Tests: a local 30-second run from the seeds made 4.7 million executions and found no failing input.
Most mutations of the three policy seeds break the JSON, and no seed has a Principal, NotPrincipal or Sid key. In four local 60-second runs from those seeds, no input in the final corpus had a statement with one of those keys, so the runs did not reach parse_principal_value or the Sid check in from_json_for_write. fuzz/dicts/policy_document.dict lists the policy keys, the Effect and Version values, the condition operators with their ForAllValues:, ForAnyValue: and IfExists forms, and CIDR forms. The Fuzz step passes the dictionary of a target with -dict when fuzz/dicts has one. One new seed has a Principal object, NotResource, a valid Sid, and ForAllValues and IfExists conditions. The other is a single statement object with NotPrincipal, NotAction, a Sid that the write path refuses, and the other operator families. Tests: the two seeds raise the start coverage that libFuzzer reports from 397 to 532. In four local 60-second runs with the seeds and the dictionary, each final corpus had 63 to 117 statements with a Principal or NotPrincipal key and 92 to 122 with a Sid. The final coverage was 1472 to 1675, against 1341 to 1595 from the old seeds.
navareamol
left a comment
There was a problem hiding this comment.
The Fuzz step's failure message says "Run cargo fuzz run locally to reproduce it". I think that promises more than the job keeps. The step writes all output, including libFuzzer's INFO: Seed: line, to a file under $RUNNER_TEMP, the generated corpus also lives under $RUNNER_TEMP, and nothing is uploaded, so the input, the seed and the corpus are gone when the job ends. A local run starts from the committed seeds with a new seed and may not hit the same input. Could the message say "to search for it" and give the run length, until #861 settles how a failing input reaches the maintainers?
I will approve once the failure message no longer says the run can be reproduced locally.
Main is 141 commits ahead of the branch, and the merge is clean. No file changed on both sides. In fuzz/ main changed three targets this branch does not change: expression_evaluate.rs, expression_parse.rs and sigv4_verify.rs.
A local cargo fuzz run cannot replay a failure of this job. The job publishes neither its log, which holds libFuzzer's seed, nor its corpus, and it passes no -seed. The message now says that a local run searches for the input. It gives the command with the job's flags and run length. The command puts an empty directory ahead of the seeds, so libFuzzer does not write new inputs into fuzz/seeds. The step comment also says that a dictionary or usage error ends with the same message, because the job prints no log.
|
Agreed, a local run cannot replay it. The job keeps neither the log, which holds libFuzzer's seed, nor the corpus, and it passes no |
navareamol
left a comment
There was a problem hiding this comment.
I approve. The failure message now says the run cannot replay the input and gives the search command and the run length.
Main is at 14ade59 (#864), ten commits after the last merge. Two files conflicted: - docs/manuals/07-upgrade-manual.md: #398 and this branch each add a v1.1.0 entry at the top of "Behavior Changes by Release". The merge keeps both entries whole, the #398 entry first and this branch's U+0000 entry after it. - crates/storage-postgres/src/data/query.rs: #588 adds string_prefix_upper_bound to the extenddb_storage::util import, and this branch imports parse_sk and pk_to_text from super::key_text. The merge imports sk_info and string_prefix_upper_bound from util and keeps the key_text import. bind_sk_condition computes the begins_with bound of #588 from the value that key_text::parse_sk returns. So a prefix that holds U+0000 still gets the ValidationException of this branch before the statement runs. The other files that both sides change merged without a conflict. In each one the two sides change different lines: - crates/storage-postgres/src/data/query_scan.rs: #588 passes the expression maps to build_sk_sql, and this branch imports from key_text. - crates/storage/src/util/mod.rs: the prefix module of #588 and the control_chars module of this branch. - crates/storage-cassandra/src/migrations/mod.rs and crates/storage-sqlite/src/migrations/mod.rs: #1173 and #1009 change imports and module declarations, and this branch adds the EscapeControlChars arm. - crates/storage/src/backup_catalog.rs: #1009 adds clippy allows, and this branch changes a doc comment. - CONTRIBUTING.md, docs/design/04-component-storage.md and docs/differences-from-dynamodb.md: each side changes its own sections. Main adds no catalog migration, so migration 13 keeps its number.
Main is at 14ade59 (#864). One file conflicted: docs/manuals/07-upgrade-manual.md. #398 and this branch each add a v1.1.0 entry at the top of "Behavior Changes by Release". The merge keeps both entries whole, the #398 entry first and this branch's entry after it. The other files that both sides change merged without a conflict: - crates/server/src/handler.rs: main moves the pre-auth request checks into extenddb_engine::parse_request and the point-in-time refusal into admit (#1009). record_segments drops its table argument and takes the segments by reference (#398). This branch changes only the error arm of the authorization step. That arm still records UserErrors and RequestCount with the two calls that the point-in-time refusal makes. - docs/design/06-component-server.md: #398's segments text and this branch's RequestCount and UserErrors paragraph are in separate places. #398 records segments only for a request that reaches dispatch, so a request refused in the authorization step adds counts and no segments.
Main is at 14ade59. This branch last had main at 018715e, through fix/query-key-value-types. Since then, these eleven commits merged into main: #1280, #1009, #596, #1173, #398, #428, #544, #567, #584, #588 and #864. #544 is the squash of fix/query-key-value-types, which was the base branch of this PR. This branch already holds the last head of that branch, 31c5f3d. Main has the same version of each conflicted file as 31c5f3d. So each conflict hunk has the lines of #544 on one side. The other side has the change of this branch to the same lines. The merge keeps the version of this branch in each file: - crates/engine/src/query_key_values.rs: this branch makes two constants and four functions pub(crate) for the Scan checks, and re-exports three functions of unreadable.rs. It reads a number in Segment and TotalSegments as it reads one in Limit, with the dates in the doc comment of shape_fault_first. It passes validate_no_parameter_mix to unreadable_value_checks. - crates/engine/src/query_key_values/unreadable.rs: this branch makes three functions pub(crate). unreadable_value_checks takes the parameter mix check as a parameter, so this branch deletes the import of validate_no_parameter_mix. - crates/server/src/request_helpers.rs: this branch runs the Scan request checks before the IAM decision, as main does for Query. - tests/test_query_leading_keys_values.py: this branch moves the setup of TestLeadingKeysWithAnInvalidKeyValue to the base class ManagementPrincipals, which tests/test_scan_checks_before_authorization.py imports. Git merged crates/engine/src/lib.rs with no conflict. Main compiles three modules only off wasm32 (backup, import_export_io and private_fs), and adds the modules backup_requests and pre_dispatch. This branch adds the module scan_request and changes the doc comment of validate_enum_fields.
Main is at 14ade59. This branch last had main at 018715e, through fix/query-key-value-types. Since then, these eleven commits merged into main: #1280, #1009, #596, #1173, #398, #428, #544, #567, #584, #588 and #864. #544 is the squash of fix/query-key-value-types, which was the base branch of this PR. This branch already holds the last head of that branch, 31c5f3d. Main has the same version of each conflicted file as 31c5f3d. So each conflict hunk has the lines of #544 on one side. The other side has the change of this branch to the same lines. The merge keeps the version of this branch in each file: - crates/engine/src/query_key_values.rs: the dates and the order in the module and function doc comments, the call of validate_condition_value_numbers, and the two functions validate_condition_value_numbers and refuse_first_fault. - crates/engine/src/query_key_values/request_order_tests.rs: the import of Value and the test legacy_condition_values_get_the_number_check. - tests/test_query_key_value_types.py: the dates in the docstring, the nn_table fixture and the helpers eq, N1, KC_ABC and QF_BOB. The merge also keeps the rows k1 to k16, and nn_table in the tables fixture and the control test. Git merged crates/engine/src/lib.rs with no conflict. This branch changes that file only through the commits of #544, so the merged file is the file of main.
Main is at 14ade59. This branch last had main at 018715e, through fix/query-key-value-types. Since then, these eleven commits merged into main: #1280, #1009, #596, #1173, #398, #428, #544, #567, #584, #588 and #864. #544 is the squash of fix/query-key-value-types, which was the base branch of this PR. This branch already holds the last head of that branch, 31c5f3d. Main has the same version of each conflicted file as 31c5f3d. So each conflict hunk has the lines of #544 on one side. The other side has the change of this branch to the same lines. The merge keeps the version of this branch in each file: - crates/core/src/partiql/params.rs: this branch deletes the two base64 imports, because decode_base64 replaces check_base64. - crates/core/src/types/attribute_value.rs: this branch adds BASE64_TEXTS, decode_base64 and is_base64_refusal after the two constants that #544 makes public. - crates/core/src/types/mod.rs: this branch adds decode_base64 and is_base64_refusal to the names that #544 re-exports. - tests/test_query_leading_keys_values.py and tests/test_query_value_shapes.py: this branch moves _raw_query to tests/raw_signed_request.py as client_post, and calls client_post in its place. No other test file on main calls _raw_query. Git merged crates/engine/src/lib.rs with no conflict. Main compiles three modules only off wasm32 (backup, import_export_io and private_fs), and adds the modules backup_requests and pre_dispatch. This branch adds serialization_exception and calls it from deserialize_error.
The base merges main at 14ade59. That brings #544 as a squash and ten other commits: #1280, #1009, #596, #1173, #398, #428, #567, #584, #588 and #864. One file conflicted: crates/engine/src/import_export.rs. #1009 moves the body of handle_import_table to import_table in the new file crates/engine/src/import_export/files.rs. The wasm32 build replaces that file with a stand-in that refuses the operation. handle_import_table keeps the enabled check and calls files::import_table. This branch changes the body that #1009 moves. When read_items finds a line that it cannot read, the import keeps the items before that line. It counts the line as one error and reads no more of the file. The merge keeps the code of main in import_export.rs, with the doc comment of this branch on handle_import_table. It makes the three changes of this branch to the body in files.rs: - The variable read holds the result of read_items: the items and the line that the reader cannot read. - The loop takes the items, then that line. At that line it logs the line number and the fault, counts one error and ends the import. - The comment over the FAILED status adds the date 2026-11-22, for the lines that the import cannot read. The body of import_table in files.rs is now the same as the body of handle_import_table at the head of this branch. Git merged docs/manuals/07-upgrade-manual.md with no conflict. #398 adds its v1.1.0 entry at the top of "Behavior Changes by Release". This branch adds its v1.1.0 entry at the end of that section.
The base merges main at 14ade59. That brings #544 as a squash and ten other commits: #1280, #1009, #596, #1173, #398, #428, #567, #584, #588 and #864. The merge has no conflict. Git merged crates/engine/src/lib.rs, the one file with changes on both sides. Main compiles three modules only off wasm32 (backup, import_export_io and private_fs), and adds the modules backup_requests and pre_dispatch. This branch adds single_write_refusal after deserialize_error.
Main is at 5252eda. The last merge of main was at 80490c6, and main has four commits since then: #864, #895, #929 and #949. They change CI workflows, the auth and fuzz crates, a PostgreSQL test and the security manual. None of them changes a file that this branch changes, so git merged them with no conflict.
Main is at db8a90d. This branch last had main at 14ade59 (#864). Since then, 35 commits merged into main. Among them, #1514 released v1.1.0 without this branch, #1166 moved to sqlx 0.9.1, and #1449 added the SearchVectors inequality filters. Four files conflicted: - crates/storage-postgres/src/vector_search.rs: #1166 passes the search statement through sqlx::AssertSqlSafe, and #1449 moves the vector attribute of a hit into hit(). This branch decodes the stored item through json_to_item. The merge keeps the wrapper and hit() of main and the decode of this branch. - docs/adr/README.md: #1449 adds ADR-0031, the search condition grammar, where this branch lists its own ADR-0031. The ADR of this branch is now ADR-0032, the next number that no ADR on main and no open PR uses. - docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md: #1514 shows version 1.1.0 in the sample output, and this branch shows catalog migration 13. The merge shows both. The upgrade manual merged with no conflict, but the U+0000 entry of this branch was a v1.1.0 entry. It is now a v1.2.0 entry after the v1.2.0 entries of main, because v1.1.0 shipped without this change. The sentence that links to the entry names 1.2.0. It also adds 1.1.0 to the releases whose deployments run extenddb migrate --yes once for migration 13. sqlx 0.9 takes SQL that is not a &'static str only in sqlx::AssertSqlSafe (#1166). The merge passes the SQL of the 18 queries that this branch adds in migration 13 and in its PostgreSQL tests in it. The SQL text does not change. m0013_tests.rs runs the migration files with raw_sql(*text), as the runner of main does. Git merged the other files that both sides change at other lines. Main adds no catalog migration, so migration 13 keeps its number.
Changes since the last review
What
fuzz/artifacts, the step fails with a fixed message that gives the command to search for the input locally. The change removes the upload step. A new Build step keeps build errors in the log..cargo/**is in thepull_requestpaths.sigv4_timestampgets only thex-amz-datevalue. The change removesbuild_header_map.policy_documentgets a dictionary infuzz/dicts/and two seeds. The Fuzz step passes the dictionary of a target with-dict.The workflow does not add
-a. cargo-fuzz 0.13.2 builds with-Cdebug-assertionsunless the command passes-O, so overflow checks anddebug_assert!are already on.Why
@robinnsc raised these points on #798.
.cargo/config.tomlapplies when the workflow buildsfuzz/Cargo.lock.validate_timestampreads onlyx-amz-date, so the extra headers used part of each input on bytes that it does not read.Refs #798
Testing done
actionlintwith shellcheck passes on the workflow, with the runner label declared.Doneandstat::lines.-rss_limit_mb=1, the run failed with an out-of-memory input. The step printed only the error line, and the lines that print the input stayed in the log file.fuzz/artifactsafter a clean run, the step failed with the error line.cargoreplaced by a function that prints a line and fails, once with a dictionary and once without. Each time the step exited 1 and printed only the error line. The command in it carried the dictionary flag only in the first run.cargo fuzz build -von nightly-2026-11-01 passed-Cdebug-assertionsand-Zsanitizer=addressto every target crate.sigv4_timestamp: a 30-second run from the seeds made 4.7 million executions and found no failing input.policy_document, four local 60-second runs for each setup:fuzz/Cargo.lockstep and its version check pass.cargo +1.97.0 fmt --checkandcargo +1.97.0 clippy --all-targets -- -D warningspass infuzz/.Checklist
cargo test --workspace)cargo fmt --check)cargo clippy -- -W clippy::pedantic)Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
The change touches only
fuzz/and the Fuzz workflow, so the workspace tests do not cover it. Clippy ran with-D warningsinfuzz/, without the pedantic group.ADR / RFC: n/a
Not in this pull request
Separate issues track these points from the #798 comments:
expression_evaluatetoward the condition and update evaluators.sigv4_verifyfixed header names with fuzzed values.By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.