Skip to content

MFA Fuzzing and Json.Unmarshal Panic fix#30854

Merged
jentfoo merged 1 commit intomasterfrom
jent/json_unmarshal_panic_fix
Aug 22, 2023
Merged

MFA Fuzzing and Json.Unmarshal Panic fix#30854
jentfoo merged 1 commit intomasterfrom
jent/json_unmarshal_panic_fix

Conversation

@jentfoo
Copy link
Copy Markdown
Contributor

@jentfoo jentfoo commented Aug 22, 2023

This expands the coverage of fuzzing in lib/web/fuzz_test.go and includes adding seeds. From this work a new panic was discovered where a pointer is allocated then a pointer to the pointer is passed into json.Unmarshal. It is then possible for this original pointer to remain a nil reference.

This pattern looks unexpected, so all cases of double pointers being passed into json.Unmarshal were changed to the more standard empty struct pointer style to avoid potential nil reference panics.

Originally opened in this PR: https://github.com/gravitational/teleport-private/pull/891 but severity was deemed low enough to fix directly in OSS

Backporting will be done through release PR's already open:

This expands the coverage of fuzzing in `lib/web/fuzz_test.go` and includes adding seeds.
From this work a new panic was discovered where a pointer is allocated then a pointer to the pointer is passed into json.Unmarshal.  It is then possible for this original pointer to remain a `nil` reference.

This pattern looks unexpected, so all cases of double pointers being passed into json.Unmarshal were changed to the more standard empty struct pointer style to avoid potential nil reference panics.
@jentfoo jentfoo self-assigned this Aug 22, 2023
@github-actions github-actions Bot requested review from jimbishopp and r0mant August 22, 2023 16:11
@jentfoo jentfoo requested review from Tener, codingllama and zmb3 and removed request for jimbishopp August 22, 2023 16:11
@jentfoo jentfoo added this pull request to the merge queue Aug 22, 2023
Merged via the queue into master with commit 259767f Aug 22, 2023
@jentfoo jentfoo deleted the jent/json_unmarshal_panic_fix branch August 22, 2023 16:51
This was referenced Aug 22, 2023
@camscale camscale mentioned this pull request Aug 23, 2023
@fheinecke fheinecke mentioned this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants