Skip to content

Fuzz the token check every night - #3

Merged
AlxcBTW merged 1 commit into
mainfrom
feat/fuzz-ticket
Oct 24, 2026
Merged

AlxcBTW merged 1 commit into
mainfrom
feat/fuzz-ticket

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 24, 2026

Copy link
Copy Markdown
Member

The token check reads whatever any client sends: the cloud runs it on every request, the relay on every endpoint that connects. This puts it under cargo-fuzz on a schedule, the same way anyplaynet/network#5 does for the network's parsers.

What

  • fuzz/, its own workspace with two targets, both signing with a fixed key that exists only in the targets:
    • ticket_forged: any UTF-8 text as a token is refused, as either kind, at any time.
    • ticket_altered: a token the cloud signed (access or relay, picked by the first byte), with bytes overwritten at positions the input chooses. It passes only when it is still exactly the issued token, and then with exactly the issued claims; the unaltered token always passes. This catches malleable encodings as well as forgeries.
  • .github/workflows/fuzz.yml: a minute per target on pull requests that touch crates/ticket or fuzz/; a quarter of an hour per target every night; workflow_dispatch takes the seconds. It checks out network beside cloud, as CI does. Corpus in the Actions cache, cmin on the nightly run, a breaking input attached as crash-<target>. cargo-fuzz pinned to 0.13.2.
  • ci.yml also checks the targets' formatting; fuzz/README.md; a row in the README table (now headed "Path", since deploy/ and fuzz/ are not crates).

Checked

  • cargo fmt (CI's -p list and the fuzz manifest), cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace: clean.
  • The targets pass cargo clippy --all-targets -- -D warnings with libFuzzer's link step turned off (libFuzzer does not build on windows-gnu); the real runs are this PR's fuzz jobs.
  • actionlint 1.7.12: clean.

Two cargo-fuzz targets read what any client may present to the cloud
and its relays. ticket_forged checks that any text is refused as either
kind at any time. ticket_altered overwrites bytes of a token the cloud
signed and checks that it passes only as it was issued, with the claims
it was issued with.

The fuzz workflow runs each target for a minute on pull requests that
touch the token check and for a quarter of an hour every night, keeps
the corpus in the Actions cache and attaches a breaking input as an
artifact. CI checks the targets' formatting.
@AlxcBTW
AlxcBTW merged commit f365afa into main Oct 24, 2026
6 checks passed
@AlxcBTW
AlxcBTW deleted the feat/fuzz-ticket branch October 24, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant