Skip to content

Fix WebAuthn/Duo credentials merge bug (OKTA-1209004)#284

Merged
AlexNachbaur merged 2 commits into
masterfrom
okta-1209004-webauthn-credentials-merge-fix
Jul 6, 2026
Merged

Fix WebAuthn/Duo credentials merge bug (OKTA-1209004)#284
AlexNachbaur merged 2 commits into
masterfrom
okta-1209004-webauthn-credentials-merge-fix

Conversation

@AlexNachbaur

@AlexNachbaur AlexNachbaur commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a regression test (testNestedWithMultipleChildValues) proving Remediation.Form.Field.formValue drops sibling fields when a named field's nested form has 2+ children — e.g. WebAuthn's credentials object (authenticatorData/clientData/signatureData), which is the root cause of OKTA-1209004.
  • Cherry-picks the fix from fixes some idx calls where the not all post body values are sent #282 (commit 634cea8): accumulate nested child values into a separate nestedJSON object via += merge, then assign once, instead of overwriting json[name] on every loop iteration.

Root cause

In IDXRemediation+Extensions.swift, the "named field with nested form" branch looped over each child field and did json[name] = nestedResult every iteration — each nested child's own {childName: value} wrapper replaced the previous one, so only the last-processed child survived. When the last child happened to be unset (e.g. optional userHandle on the autofill UI challenge), the result was an empty credentials: {}, matching the customer's HAR capture on Crate & Barrel's org.

This affects:

  • WebAuthnAuthenticationCapability (passkey/WebAuthn auth) — confirmed via mock fixture (3 fields)
  • WebAuthnRegistrationCapability (passkey/WebAuthn registration) — confirmed via mock fixture (2 fields)
  • DuoCapability — only sets a single field today, so not currently exercised by this bug, but not covered by a fixture-based test either

AlexNachbaur and others added 2 commits July 3, 2026 10:37
Remediation.Form.Field.formValue overwrites json[name] on every iteration when a named field has a nested form with multiple children (e.g. WebAuthn's credentials object), instead of merging them. Only the last-processed child survives.
@AlexNachbaur
AlexNachbaur merged commit b9e0818 into master Jul 6, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants