Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[CVE-2020-27197] Avoid SSRF on parsing XML #247

Merged
merged 4 commits into from
Oct 19, 2020

Conversation

orsinium
Copy link
Contributor

What

  1. Avoid local file inclusion where it is possible when parsing XML.
  2. Avoid SSRF when parsing XML.

How

  1. Add alllow_url=False option for parse. If it is False, the function checks that the passed string has no URL scheme specified.
  2. Add allow_path=True option for parse. If it is False, use etree.fromstring instead of etree.parse.
  3. Explicitly specify the allow_path value for every call of parse.

Tests

Tests are included.

Links

Closes #246

@orsinium
Copy link
Contributor Author

Tested on our staging environment, the fix seems to be working as expected.

@orsinium orsinium changed the title Avoid SSRF on parsing XML [CVE-2020-27197] Avoid SSRF on parsing XML Oct 19, 2020
@emmanvg emmanvg added this to the libtaxii 1.1.118 milestone Oct 19, 2020
Copy link
Contributor

@emmanvg emmanvg left a comment

Choose a reason for hiding this comment

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

Thanks for confirming the fix @orsinium.

@emmanvg emmanvg merged commit 23c6f7b into TAXIIProject:master Oct 19, 2020
@orsinium orsinium deleted the fix-ssrf branch October 19, 2020 13:49
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blind SSRF vulnerability
2 participants