-
Notifications
You must be signed in to change notification settings - Fork 24k
Make sure that all no_log parameters are processed even if some arguments have values of the wrong type #81672
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
base: devel
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm, but would like a test to avoid regressions
@bcoca it is impossible to test this situation without having #81631 merged, since the bug fixed by #81631 makes the module crash when the code from this PR adds an error message. Basically the test fixed in 1e61657 serves as a regression test for this PR - but only when #81631 is merged, since without it that test passes because the module crashes, and not necessarily because the code touched in this PR is correct. |
bugfixes: | ||
- argument spec validation - make sure that all ``no_log`` parameters are processed even if some arguments have values of the wrong type (https://github.com/ansible/ansible/pull/81672). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is just a preventative measure, this should probably be a minor_changes fragment.
bugfixes: | |
- argument spec validation - make sure that all ``no_log`` parameters are processed even if some arguments have values of the wrong type (https://github.com/ansible/ansible/pull/81672). | |
minor_changes: | |
- argument spec validation - process all ``no_log`` parameters recursively before validating the argument spec (https://github.com/ansible/ansible/pull/81672). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once #81631 or something equivalent is merged, this fixes a real CVE-worthy bug.
The only reason this isn't a bug right now is that a crash in another part is preventing this bug to have any effect. It is still a bug IMO.
…ents have values of the wrong type.
SUMMARY
Currently the
no_log
value processing terminates prematurely if values that should be dictionaries or lists of dictionaries have the wrong type. This can cause values passed tono_log
parameters to show up in logs. The reason why that doesn't happen right now is another bug which makes argspec validation crash in that case later on (that bug is fixed in #81631). See the discussion in #81631 for details.The patch was provided by @s-hertel in #81631 (comment), I added a changelog fragment and refactored the code slightly to remove code duplication.
ISSUE TYPE