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 yaml warning #1165

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Conversation

EXTREMOPHILARUM
Copy link
Contributor

Yaml library deprecated the yaml.load function without the Loader parameter. This led to the framework showing a yaml.load warning on every start when configuration YAML files are being loaded.

Description

This PR fixes the warning popup.

Before

image

After

image

Reviewers

@viyatb

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other

Checklist:

  • My code follows the code style (modified PEP8) of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@@ -32,7 +32,7 @@ def load_config_file(file_path, fallback_file_path):
# check if the config file exists
abort_framework("Config file not found at: {}".format(file_path))
try:
config_map = yaml.load(FileOperations.open(file_path, "r"))
config_map = yaml.load(FileOperations.open(file_path, "r"), Loader=yaml.FullLoader)
Copy link
Member

Choose a reason for hiding this comment

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

this is actually very insecure - can you use safe_load function provided by the PyYAML? it would be great if you can also fix this anywhere we load YAML files 🙀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure will do that.

@viyatb
Copy link
Member

viyatb commented Oct 15, 2021

@EXTREMOPHILARUM can you actually go over the entire codebase and change it to safe_load? This is vulnerability where a malicious YAML can trigger an RCE on OWTF :)

@EXTREMOPHILARUM
Copy link
Contributor Author

Sure will go through it

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

2 participants