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

Disable entities while parsing XML #1

Merged
merged 1 commit into from
Aug 25, 2021

Conversation

jorgectf
Copy link
Contributor

@jorgectf jorgectf commented Aug 25, 2021

If an attacker supplies a url returning malicious XML content, they may be able to leak internal information such as files, and/or cause a denial of service.

Entrypoint:

url = request.args.get('url')

Getting into ocr_to_dict:

parsed_text = ocr_to_dict(url)

User-controlled URL request:

req = requests.get(url)

Vulnerable parser declaration:

parser = lxml.etree.XMLParser(ns_clean=True,
recover=True,
encoding='utf-8')

Sink:

xml = lxml.etree.fromstring(text, parser=parser)

More information:

@WillemJan WillemJan merged commit e88008d into KBNLresearch:master Aug 25, 2021
@jorgectf jorgectf deleted the fix-xxe branch August 26, 2021 21:09
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.

2 participants