Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw error if there is incorrect relatesTo in IDX response #1421

Merged

Conversation

denysoblohin-okta
Copy link
Contributor

@denysoblohin-okta denysoblohin-okta commented Jun 26, 2023

If there is incorrect relatesTo in IDX response from server, it can lead to unexpected behaviour, so throw an error.

In the infinite requests bug scenario remediation select-authenticator-authenticate was falsely selected instead of challenge-authenticator, because canRemediate() returns true due to mistake in line 36:

.find(({ relatesTo }) => relatesTo.key === authenticator.key);

Phone authenticator has incorrect relatesTo: "$.authenticatorEnrollments.value[9]", so relatesTo.key is undefined and authenticator.key is also undefined, leading to false equality.
Just adding protection against undefined to line 36 fixes infinite loop bug.

Internal ref: https://oktainc.atlassian.net/browse/OKTA-612326

@denysoblohin-okta denysoblohin-okta marked this pull request as ready for review June 26, 2023 15:36
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.

None yet

3 participants