Repository navigation
feat(forms): confirmation can show opted-in submitted fields (#527) - #700
Merged
Merged
Conversation
confirmation.show lists fields to show on the confirmation page, and the
message may place them as {field} placeholders. Values reach the page in
an AES-256-GCM sealed __Host- cookie (HKDF key from the CSRF secret, flow
and CSRF binding cookie as associated data, 5-minute expiry, 2 KiB cap,
cleared on read). Anything else renders the fixed page. Startup refuses
undeclared show fields and placeholders not listed in show.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
force-pushed
the
feat/forms-confirmation-fields
branch
from
September 25, 2026 00:21
e78be61 to
7565db7
Compare
This was referenced Sep 25, 2026
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 #527
What
A forms flow can opt submitted fields into its confirmation page:
confirmation.showlists the fields to show. The message can place any of them inline as a{field}placeholder. Listed fields that the message does not use follow as a<dl>of label and value. A checkbox reads Yes/No and a select shows its option label. A field that is not listed never leaves the POST.showentry that is not a declared field, and a{field}placeholder whose field is not inshow. Placeholders use the field-name grammar[a-z][A-Za-z0-9_]*, so any other braces stay literal text. I added no restriction by field type: every admitted value is already bounded and escaped, the vocabulary has no password or secret input type, andshowis the author's explicit allowlist.{email}-bearing value).Cache-Control: no-store. The extension sets it explicitly, and core's privacy floor also forces it.onSubmitcontract is unchanged. The handoff is issued only afteronSubmitsucceeds.Handoff design and why
The handoff is a stateless sealed cookie,
__Host-urlcode-forms-confirmation(Path=/; Secure; HttpOnly; SameSite=Strict; Max-Age=300), set on the 303:urlcode-forms-confirmation-v1), which keeps it separate from the secret's HMAC use for CSRF tokens. GCM's tag provides the authentication that an HMAC would, and the encryption means values are never readable in the cookie.__Host-urlcode-forms-csrfbinding cookie are GCM associated data. A handoff sealed for another flow or another browser, or with no binding cookie, does not decrypt.showvalues and an expiry. The plaintext is capped at 2 KiB of JSON. Above the cap no handoff is issued, and the page renders the fixed form.__Host-: it rules out a sibling subdomain setting the cookie, which a path-scoped__Secure-cookie cannot guarantee. The value is ciphertext, so sending it on other paths of the same origin exposes nothing.Max-Age=0) whether or not it opened, so a refresh shows the fixed page. HEAD answers with the fixed page and leaves the cookie in place.Limitation, documented in
packages/forms/SECURITY.md: clearing happens in the browser, so this is not server-enforced single use. Within its 5 minutes, only the same browser, holding both HttpOnly cookies, could present it again.Tests (
packages/forms/test/forms.test.ts)Date), and an oversized handoff (not issued).showfield and a placeholder that is not inshow, including whenshowis absent. Literal braces are accepted.Docs
README.md: new section "Showing submitted values on the confirmation".SECURITY.md: new "Confirmation values" section.CHANGELOG.md(Unreleased) andllms.txt.docs/EXTENSIONS.mdanddocs/FRAMEWORK.md: wording changed from "fixed confirmation".urlcode.jsonregenerated withnpm run build:addons.YAML-REFERENCE.mddoes not cover extension config.Verification
npm run typecheck: passnpm run verify: exit 0 (core 798/798; workspace suites all pass;build-addon-manifest --checkclean;llms-full.txtregenerated withnpm run docs:llms)npm run test:package: exit 0 (package audit plus packed installation and starter/cookbook smoke)CI passing is not an independent security review.
🤖 Generated with Claude Code