GeezerVison is showing github.com — id(currency): sign_authorisation never calls validate — a signed authorisation naming another issuer or with rate_den = 0 is dead on arrival, and signing succeeds silently · Issue #6422 · developing-today/code
id(currency): sign_authorisation never calls validate — a signed authorisation naming another issuer or with rate_den = 0 is dead on arrival, and signing succeeds silently #6422Descriptionid(currency): sign_authorisation never calls validate — a signed authorisation naming another issuer or with rate_den = 0 is dead on arrival, and signing succeeds silently
Summary
pkgs/id/src/currency.rs has exactly one validity contract for a RateAuthorisation body — RateAuthorisation::validate (issuer must equal the event author; rate_den must be non-zero) — and the fold enforces it (fold_authorisation filters on body.validate(author).is_ok(), currency.rs:299 at origin/main a2b4345e80). But the signing entry point, sign_authorisation (currency.rs:328), never calls it: it serializes the body and hands it straight to chain::sign. A signer can therefore produce a properly signed, chain-valid event whose body is invalid by the module's own two hard rules, and nothing anywhere will ever fold it as Live:
- Issuer mismatch: body names issuer B, signed by A.
fold_authorisation(.., expected_issuer = B) ignores the event (its author is A, not B); fold_authorisation(.., expected_issuer = A) drops the body at the validate filter (body names B). The signed object is unreachable in every fold.
rate_den = 0: validate rejects it as ZeroRateDenominator, so the fold drops it — yet it sits on the issuer's chain as a signed version, and (per the fold's version-selection order: filter first, then max-by-version) it does not shadow a good lower version, but it does permanently occupy its sequence slot and reads as a real signed authorisation to any consumer that decodes without folding.
This is the sign-side half of the contract the artifact module already closed in #5623 ("validate known-kind bodies in SignedArtifact::sign / sign_after"): a signed object should be validated as strictly at creation as it is at consumption, so the mistake surfaces at sign time — where the caller can fix it — instead of as a silent no-op in every later fold.
Evidence (verified this run, origin/main a2b4345e80)
git grep -n "validate" pkgs/id/src/currency.rs returns exactly three sites: the definition (currency.rs:153), the fold filter (currency.rs:299), and one test (currency.rs:513). sign_authorisation and sign_revoke contain no validation call.
- Probe (laptop, worktree of origin/main at
a2b4345e80, integration test pkgs/id/tests/probe_currency_sign.rs in worktree ~/git/fleet/probe-currency-sign-wt, run with cargo test --test probe_currency_sign -- --nocapture): sign(issuer-mismatch body) -> Ok, sign(rate_den=0 body) -> Ok, sign(valid body) -> Ok (control), and the mismatched body folds to None for both the signing issuer and the named issuer — dead on arrival, exactly as the code reading predicts. (The probe test asserts the desired refusal, so it fails on current main at the issuer-mismatch assertion; the printed lines above are the observed behavior.)
- Existing test coverage signs only a valid body (
signed_events_round_trip_through_the_fold), so the gap produces no red signal today.
Why it matters
sign_authorisation is the only sanctioned way to create these objects (Phase 1 of #2290; the conversion engine #5536 builds on it). An LP tool that mis-sets issuer_id (e.g. copies a counterparty's body as a template) or a rate with a zero denominator gets a successful signature, a chain event, and a reference hash to hand out — and the authorisation simply never exists for any consumer. That is the worst failure shape for a signed-object system: creation reports success, consumption silently ignores. Failing at sign time with the existing ValidateError vocabulary costs one call; the artifact precedent (#5623) shows the fleet's chosen shape for exactly this fix.
Acceptance criteria
-
sign_authorisation refuses a body that validate would reject for the signing key's issuer (issuer mismatch, rate_den = 0), surfacing the refusal through SignError (a new variant wrapping ValidateError is fine); no event is produced for an invalid body.
- Tests: signing an issuer-mismatched body and a
rate_den = 0 body both error; the existing valid-body round-trip test still passes unchanged.
- The fold's behavior is unchanged (invalid bodies from other/legacy signers are still ignored, not folded).
- Out of scope: extending
validate's rule set — that is id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071, open separately. This issue only enforces the two rules that already exist, at sign time.
Notes
- Related: id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071 (validate accepts internally inconsistent bodies — the rule-set extension; complementary, not duplicate: it never mentions the sign path, and its fix would not make
sign_authorisation call validate), id(artifact): validate known-kind bodies in generic signing helpers #5623 (the artifact-module precedent for sign-side validation), id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290 / id: implement RateAuthorisation as a signed ID-graph object (design #2290) #5521 (the RateAuthorisation design/implementation this module serves).
- Found by Lane B (new-issue-creator-code-b), weighting away from Lane A's recent fleet-config filings and Lane B's own recent dead-test filings.
Activitydeveloping-today commented on Nov 6, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests app/idPackage/app: id (pkgs/ or apps/ in this repo) on Nov 6, 2026dezren39 commented on Nov 6, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (new-issue-creator-code-b)
- Session / ID: cron new-issue-creator-code-b run 2026-11-05 20:20 CST (2026-11-06T02:36Z)
- Found via: filed this run
- Task: Filed issue id(currency): sign_authorisation never calls validate — a signed authorisation naming another issuer or with rate_den = 0 is dead on arrival, and signing succeeds silently #6422 — sign_authorisation (pkgs/id/src/currency.rs:328) never calls RateAuthorisation::validate, so issuer-mismatched and rate_den=0 bodies sign successfully yet can never fold Live; verified with a laptop probe on origin/main a2b4345 (both invalid bodies sign Ok, mismatched body folds None for both issuers, valid control signs Ok and folds Live).
- Expectation: effort s — enforce the existing validate() at sign time via SignError, with refusal tests; fold unchanged. Enqueued as a small-fix packet on repo-health-code-pilot.
- Links: issue id(currency): sign_authorisation never calls validate — a signed authorisation naming another issuer or with rate_den = 0 is dead on arrival, and signing succeeds silently #6422; related issue id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071 (validate rule-set extension, separate), issue id(artifact): validate known-kind bodies in generic signing helpers #5623 (artifact sign-side precedent)
dezren39 commented on Nov 6, 2026
Agent note — task 10861 handed off (lane code-n)
dezren39 commented on Nov 11, 2026
Agent note — parked (CI wait on PR #8677)
dezren39 commented on Nov 11, 2026
Agent note — task 10861 done (fixed_merged, PR #8677 shepherded)
- Lane: any-d (repo-worker-code), queue repo-health-code-pilot
- Transition: claimed -> done
- PR fix(id): enforce validate() in sign_authorisation (#6422) #8677 shepherded: merged current main into its branch (clean; diff vs main is only pkgs/id/src/currency.rs, +54/-2), re-ran the suite —
cargo test -p id --lib currency::: 30 passed, 0 failed, including the two new refusals (sign_authorisation_refuses_an_authorisation_for_another_issuer, sign_authorisation_refuses_a_zero_rate_denominator). No Codex inline findings on the PR.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|