security: remediate two review passes + harden REST/JSON-RPC macros - #25
Open
JedimEmO wants to merge 2 commits into
Open
security: remediate two review passes + harden REST/JSON-RPC macros#25JedimEmO wants to merge 2 commits into
JedimEmO wants to merge 2 commits into
Conversation
Consolidates the security/review-remediation-2026-08 branch: remediation of an
external security review, device-integration hardening of rest_service! with
jsonrpc_service! parity, and the follow-up fixes from a multi-agent code review.
Version bumps + cascaded {path,version} requirements per VERSIONING.md.
External security review (H1-H4, M1-M6, L1-L3, D1):
- H1 OAuth2 reserved-parameter denylist; H2 cookie auth requires CSRF
(validate() fails closed; builders auto-install a default CsrfConfig);
H3 WebSocket/upgrade errors sanitized; H4 oauth2-demo hardened.
- M1 JSON-RPC 403 no longer leaks the caller's grant set; M2 default OAuth
start-flow binds against login CSRF; M3 optional iss/aud on JWT sessions;
M4 an empty permission group can no longer grant any authenticated user
(runtime deny + compile error in all four macros); M5 WS bearer extraction
matches HTTP; M6 id_token issuer/sub/azp checks fail closed.
- L1 redacting Debug for secrets; L2 constant-time CSRF compare; L3 doc fix.
rest_service! hardening + jsonrpc_service! parity:
- Content-Type enforcement (415, opt-out require_json_content_type); rejection
and malformed-body logging; docs_require_auth gate; per-endpoint body_limit
and opt-in headers; 204/205 empty body; 413-vs-400 split; build-time
auth-provider assertion.
Multi-agent review remediation:
- 204 empty body no longer breaks the generated client for non-unit response
types; OAuth2 request-object denylist + id_token `sub` requirement; CsrfConfig
rejects CORS-safelisted header names; REST logs via a ras_rest_core::tracing
re-export (no undeclared consumer dependency); documented version pins
re-synced; six re-exporting crates bumped to 0.2.0 + cascade.
Full workspace: 855 tests pass, clippy -D warnings clean, cargo deny/audit clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ingests the one library-relevant open Dependabot advisory: opentelemetry_sdk 0.32.0 -> 0.32.1, used by the published ras-observability-otel crate. quinn-proto was already bumped to 0.11.16 (>= the 0.11.15 fix) earlier on this branch. The remaining open alerts are npm build-tooling in the wasm-ui-demo example only (vite/postcss/brace-expansion/tar), not on any published crate. cargo deny check advisories + cargo audit clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates three security/quality workstreams onto one branch. The tree is green throughout: 855 tests pass,
clippy -D warningsclean,cargo deny check advisories+cargo auditclean. Crate versions are bumped and the{ path, version }requirements cascaded perVERSIONING.md.1. External security review remediation (H1–H4, M1–M6, L1–L3, D1)
Every code-level claim in the review was verified true; overstated severities were downscoped rather than inflated.
validate()fails closed;with_cookie/ generatedauth_cookieauto-install a defaultCsrfConfig) · H3 WebSocket/upgrade errors sanitized (ServerError::client_message()) · H4 oauth2-demo hardened (fragment token delivery, binding cookie, CORS pinned, admin gated onemail_verified).iss/audon JWT sessions · M4 an empty permission group can no longer grant any authenticated user (runtime deny + compile error in all four macros) · M5 WS bearer extraction matches HTTP · M6 id_token issuer/sub/azp fail closed.Debugfor secrets · L2 constant-time CSRF compare · L3 README wording.2.
rest_service!hardening +jsonrpc_service!parityFrom a device-integration adopter's feedback, then mirrored in JSON-RPC:
415, opt-outrequire_json_content_type), malformed-body and rejection logging,docs_require_authgate, per-endpointbody_limitand opt-inheaders, empty204/205body,413-vs-400split, and a build-time auth-provider assertion.3. Multi-agent review remediation
A 4-agent review of the branch surfaced 28 findings (0 critical, no auth bypass in the default stack). Fixed the real ones:
null).request/request_uri/response_mode/…) + id_tokensubrequirement (fail-closed binding).CsrfConfig::validate()rejects CORS-safelisted header names (theheader_presence_onlyfootgun).ras_rest_core::tracingre-export — no undeclared consumer dependency (parity with the JSON-RPC fix).0.2.0+ cascade.Verification
🤖 Generated with Claude Code