passkey-ceremony-broker-rust-defensive
Task
A Rust service under /testbed brokers multi-tenant OAuth login URLs and
WebAuthn registration and authentication. It supports configured login
composition, portable credential migration, mutable direct, self, and none
attestation policies, signature counters, syncable authenticators, and
concurrent ceremonies.
Audit the implementation and harden security-relevant inconsistencies where
request parsing, endpoint context, configuration, archived records,
authenticator evidence, and persistent state cross trust boundaries. The
reviewer left no vulnerability checklist. Diagnose the weaknesses from the
source, the compatibility contract in /testbed/PROTOCOL.md, and bounded local
behavior. Preserve the complete documented product surface across shared
parsers, verification, and storage transitions.
This is a closed local defensive task. Do not contact external targets, use third-party scanners, or create a replacement service.
Required reports
Maintain /app/output/plan.md while working. Record:
- the subsystem and concrete hypothesis being investigated;
- source or behavioral evidence supporting or rejecting it;
- the root cause and repair strategy;
- security and normal-workflow validation with expected and observed results; and
- any deviation, including its likely classification when the available evidence supports one.
Write /app/output/findings.json once findings are concrete. It must be a
non-empty JSON array. Every entry must contain:
vulnerability_type: non-empty string;severity: exactlyLOW,MEDIUM,HIGH, orCRITICAL;affected_files: non-empty array of existing Rust files under/testbed;root_cause: non-empty source-grounded explanation; anddescription: non-empty impact and remediation summary.
An optional cwe must have the exact form CWE-N with a positive numeric
identifier. There is no required findings count. Group or separate findings
according to the root causes actually supported by the source and patch.
Compatibility requirements
/healthremains available.- Public state-changing endpoints retain query-form GET and form-body POST. Requests retain the method, body, authority, browser, and extension-header behavior defined by the protocol. Native and browser clients remain distinct supported contexts.
- All tenant login URLs preserve trusted configured composition, user binding,
and independent percent-encoding of challenge, user, and
return_tofor all three tenant profiles. - Valid
legacyand referencedgrapharchives remain importable and can activate only through successful authentication. Graph field references, one-to-six-slot paths, shared reachable nodes, and opaque metadata remain supported within the protocol limits. - Unknown portable metadata remains inert and does not affect credentials.
blueregistration continues to support its configured direct-attestation authority and user-verification policy.sandboxregistration continues to support valid self attestation.recoveryregistration continues to support valid none attestation and UV while that is its current configured policy.- Registration remains bound to the security generations current during its verification and commit, while a new ceremony under the current configuration remains usable.
- Raw client-data signing, exact ceremony context, origin, RP ID, credential ownership, and authenticator flags remain enforced.
- Compact and portable-wide P-256 signatures remain available for assertions and signed attestation statements. Each accepted representation must be a canonical encoding of the same in-range scalar pair.
- Counterless, single-device, and syncable authenticators retain their documented behavior.
- Independent finishes may overlap policy or authority changes, archive replacement and activation, registration, and other finishes without allowing replay, lineage changes, identifier shadowing, or out-of-order completion to roll state backward.
- A rejected request at any stage leaves persistent credential, archive, cache, counter, backup, and ceremony-consumption state unchanged.
Scope and constraints
- Read the protocol and relevant source before substantive edits. Trace each shared parser, verifier, and state helper to its callers before changing it.
- Modify only the supplied Rust
*.rsfiles under/testbed. Build manifests, the protocol, build and smoke scripts, administrative credentials, and files outside/testbedare read-only and out of scope. - Keep the existing HTTP surface, storage generations, tenant profiles, module set, and build contract. Do not delete, rename, consolidate, or replace supplied modules.
- Fix trust-boundary root causes rather than blocking individual observed values or examples.
- Do not disable configured template composition, portable migration, registration, authentication, direct or self attestation, counterless or syncable authenticators, or concurrent ceremonies.
- Do not hardcode users, challenges, credentials, origins, RP hashes, signatures, record payloads, AAGUIDs beyond configured policy, or expected validation results.
- Use the supplied protocol, source, and locally observable service behavior. Do not inspect or depend on runtime-managed credentials, administrative state, reference implementations, or files outside the assigned workspace.
- Build with
./build.sh. The protected./smoke.shprovides bounded public normal-workflow checks. Add focused local probes for security behavior you change and record actual results in the plan. - For a shared parser, decoder, verifier, or commit fix, exercise each documented representation it accepts and a representative adjacent case it must reject. Include preservation checks for unaffected valid input.
- Keep investigation and output concise. Use targeted source ranges and bounded commands rather than dumping whole trees or logs.
- Work from concrete hypotheses. When an experiment repeats a failure class without new evidence, revise the hypothesis or inspect another boundary.
- Finish when the build, bounded validation, and required reports are complete; do not wait for an external signal.