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

Insecure pyyaml call to load() #30779

Closed
vince-ice opened this issue Jul 18, 2019 · 1 comment
Closed

Insecure pyyaml call to load() #30779

vince-ice opened this issue Jul 18, 2019 · 1 comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@vince-ice
Copy link

PyYAML calls to load() by Processing allow to execute arbitrary function calls.
Please see yaml/pyyaml#265

Describe the bug
It is reported that in PyYAML before 4.1, usage of yaml.load() function on untrusted input could lead to arbitrary code execution. It is therefore recommended to use yaml.safe_load() instead. With 4.1, yaml.load() has been changed to call safe_load().

QGIS and OS versions
QGIS 3.4.7-Madeira

Patch
Please consider changeing /usr/share/qgis/python/plugins/processing/algs/help/init.py , inside loadShortHelp, line 46
from:
for k, v in yaml.load(stream).items():
to:
for k, v in yaml.safe_load(stream).items():

@vince-ice vince-ice added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jul 18, 2019
@gioman gioman added the Processing Relating to QGIS Processing framework or individual Processing algorithms label Jul 18, 2019
@DelazJ
Copy link
Contributor

DelazJ commented Jul 24, 2019

Looking to the source, I see at https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/help/__init__.py#L44
for k, v in yaml.load(stream, Loader=yaml.SafeLoader).items(): so I guess it's fixed. Note that this change is not ported to 3.4 though (I don't know if it's an omission or intended).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

4 participants