Repository navigation
fix: v0.21 security review follow-ups for the API - #567
Merged
Merged
Conversation
…credential Device binding now comes from the deviceType stored at registration, and counts only when that registration's attestation was verified. An assertion whose backup eligibility flag differs from the stored value is refused at sign-in and step-up. Refs #552
The schema accepts upper-case UUIDs and Postgres matches them case-insensitively, so case variants of one id each got a bucket of their own. The multi-instance note in production operations now names the notice limits, which stay per instance until a shared store exists. Refs #553
…tribution Notice text that contains a URL, a www address, a domain name or an email address is refused, so actionUrl stays the only link. The attribution moves to the first line, where the text cannot precede it with an imitation. Refs #554
…ents_enabled off Refs #555
findActiveOidcClient now treats a client that is not first-party as inactive while third_party_clients_enabled is off, so client metadata, secret checks, /oidc/sign, notice tokens and back-channel logout all fail closed, the same pattern verifyOidcClientSecret uses for allow_client_secrets. Refs #555
… unguarded staging fetches Refs #556
…es in every mode Every response now starts with Cache-Control: no-store, which routes that publish public material (JWKS, hashed dashboard assets) override. Provider requests use the guarded socket in every mode; outside production any host may be private, but link-local and unspecified addresses stay refused, whether named or resolved. The socket leg moves to providerTransport so the suite can keep answering provider calls from a stubbed fetch. Requiring the external delivery subject is left for a coordinated change with the seamless-cli conformance harness; its reproducing test is marked as an expected failure. Refs #556
… does not deliver Refs #557
Under external delivery, a notice whose kind the caller does not list in x-seamless-auth-delivery-kinds is now sent through the API's own transport for its channel when one is configured, instead of being recorded as not_sent_external_delivery and dropped. Refs #557
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.
Fixes the six API findings from the v0.21 security review (epic #558). Each was reproduced on
mainfirst: every issue has atest(...)commit that fails there, followed by its fix. The test commits were made with--no-verify, because the pre-commit hook runs the full coverage suite and a deliberately failing test cannot pass it. Lint, format, typecheck and commitlint were run on them by hand, and every fix commit went through the hook.Closes #552
Closes #554
Closes #555
Closes #557
Refs #553 (partly: the shared rate-limit store stays open)
Refs #556 (parts 1 and 3: the delivery token subject stays open)
The release PR #566 is untouched. This merges to
mainand ships with v0.23.0 when the milestone is done.Review first
deviceType, and counts only when attestation was verified. Deployments on the defaultnoneattestation, and credentials registered before the device type was stored, now getacr=phr/amr=swkinstead ofphrh/hwk. A relying party that requiresphrhstops being satisfied unless the deployment verifies attestation. An assertion whose backup-eligible flag differs from registration gets 401.www., a dotted domain (including fullwidth dots) or an email is refused with 400. That also refusesNode.jsorfile.txt.@seamless-auth/typesdoes not carry the rule yet, so SDK-side validation will not catch it.The rest
docs/production-operations.mdnow says notice limits multiply by the instance count. A shared store is a design decision left on the issue.Sent by <app> through <instance>.instead of ending with it.findActiveOidcClienttreats a third-party client as inactive whilethird_party_clients_enabledis off, covering metadata, secret checks, signing, notice tokens, links and back-channel logout.Cache-Control: no-storeby default (JWKS and hashed dashboard assets keep their own).providerFetchuses the guarded socket in every mode: outside production, link-local, unspecified andfe80::/10addresses are refused, named or resolved, and the 1 MB cap and 10 s timeout apply. Part 2 (requiring theseamless-auth-external-deliverysubject) is not done: it would break the seamless-cli conformance harness, which mintssub: seamless-verify. The reproducing test stays asit.failswithTODO(#556)intests/unit/lib/externalDelivery.spec.ts.canSendNoticeDirectly), otherwise recorded asnot_sent_external_delivery. A recovery that used to fail with503 recovery_notice_failedfor that reason now goes ahead. Admin identity-change notices inidentityChangeService.tsare unchanged.Changesets: #552, #554, #555 and #557 are
minorbecause they change existing behavior. The others arepatch.Checks
Unit suite 2833 passed (1 expected fail, 1 todo). Postgres suite 2891 passed. Coverage 99.03% statements, 95.82% branches. format, lint, typecheck, build pass, and
generate:apishows no drift.