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

Fix a false positive condition yaml_load #927

Merged
merged 1 commit into from
Jul 10, 2022
Merged

Commits on Jul 9, 2022

  1. Fix a false positive condition yaml_load

    The yaml.load() function has a second argument that is typically
    passed as a kwarg. However, someone could pass as a positional
    argument as well. In such a case, Bandit would flag code passing
    a SafeLoader even though that is validly secure.
    
    The fix involves looking at the positional args. However, the
    convenience function to do so also had no handling of ast.Attribute
    as args. So get_call_arg_at_position() was modified to function much
    like call_args().
    
    Closes PyCQA#546
    
    Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
    ericwb committed Jul 9, 2022
    Configuration menu
    Copy the full SHA
    abac8d3 View commit details
    Browse the repository at this point in the history