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

Backport of fix TypeCommaIntSlice panic caused by json.Number input into release/1.8.x #15081

Conversation

hc-github-team-secure-vault-core
Copy link
Collaborator

Backport

This PR is auto-generated from #15072 to be assessed for backporting due to the inclusion of the label backport/1.8.x.

The below text is copied from the body of the original PR.


Vault will panic when it attempts to parse fields with a schema of TypeCommaIntSlice if the provided value is an integer specifically if provided within the JSON body of an HTTP request. This is similar to a recent fix that was implemented for TypeCommaStringSlice which was fixed in #14522. The issue resides in mapstructure.StringToSliceHookFunc.

The fix provided in this pull request is to check if the raw input is of type json.Number and then calling String().

Fixes #15057

@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/fix-TypeCommaIntSlice-json-number-panic/formerly-pleasant-wildcat branch from f394512 to d3dfd2c Compare April 18, 2022 20:43
Copy link
Contributor

@raskchanky raskchanky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think technically you can approve these yourself since the backport assistant opened the PR 😆

@mladlow
Copy link
Collaborator

mladlow commented Apr 18, 2022

For code changes it would be better to get a second approval. You can approve yourself for backported docs changes.

Edit: I need to clarify this in the backport assistant documentation.

@ccapurso ccapurso merged commit debe31e into release/1.8.x Apr 18, 2022
@ccapurso ccapurso deleted the backport/fix-TypeCommaIntSlice-json-number-panic/formerly-pleasant-wildcat branch April 18, 2022 22:25
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

4 participants