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(security): Load yaml in safe mode #28

Open
germainlefebvre4 opened this issue Feb 5, 2021 · 0 comments
Open

fix(security): Load yaml in safe mode #28

germainlefebvre4 opened this issue Feb 5, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@germainlefebvre4
Copy link
Owner

Current status: Yaml configuration file is loaded as raw file.

$ pipenv run bandit -r handler.py
>> Issue: [B506:yaml_load] Use of unsafe yaml load. Allows instantiation of arbitrary objects. Consider yaml.safe_load().
   Severity: Medium   Confidence: High
   Location: handler.py:35
   More Info: https://bandit.readthedocs.io/en/latest/plugins/b506_yaml_load.html
34      with open("/etc/config/ns-killer.conf", 'r') as ymlfile:
35          cfg = yaml.load(ymlfile, Loader=yaml.FullLoader)

Solution:

  • Enable safe_mode in yaml loader
@germainlefebvre4 germainlefebvre4 added the enhancement New feature or request label Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant