Improper input validation
Improper input validation can enable attacks and lead to unwanted behavior.   Parts of the system may receive unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution.
def yaml_load_noncompliant():
    import json
    import yaml
    response = yaml.dump({'a': 1, 'b': 2, 'c': 3})
    # Noncompliant: uses unsafe yaml load.
    result = yaml.load(response)
    yaml.dump(result)
def yaml_load_compliant():
    import json
    import yaml
    response = yaml.dump({'a': 1, 'b': 2, 'c': 3})
    # Compliant: uses safe yaml load.
    result = yaml.load(response, Loader=yaml.CSafeLoader)
    yaml.dump(result)