Fix WebAuthn/Duo credentials merge bug (OKTA-1209004)#284
Merged
Conversation
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.
jaredperreault-okta
approved these changes
Jul 6, 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.
Summary
testNestedWithMultipleChildValues) provingRemediation.Form.Field.formValuedrops sibling fields when a named field's nestedformhas 2+ children — e.g. WebAuthn'scredentialsobject (authenticatorData/clientData/signatureData), which is the root cause of OKTA-1209004.nestedJSONobject via+=merge, then assign once, instead of overwritingjson[name]on every loop iteration.Root cause
In
IDXRemediation+Extensions.swift, the "named field with nested form" branch looped over each child field and didjson[name] = nestedResultevery 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. optionaluserHandleon the autofill UI challenge), the result was an emptycredentials: {}, 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