Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion vulnerable_xxe.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def upload_xml():
xml_file = request.files['file']
content = xml_file.read()

root = ET.fromstring(content)
import defusedxml.ElementTree as SafeET
root = SafeET.fromstring(content)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing defusedxml dependency in project Pipfile

High Severity

The fix imports defusedxml.ElementTree but defusedxml is not declared as a dependency in Pipfile (or Pipfile.lock). This means the /upload_xml endpoint will raise an ImportError at runtime because the package won't be installed in the environment. The security fix effectively breaks the endpoint entirely.

Fix in Cursor Fix in Web


return f"Uploaded: {root.tag}"

Expand Down
Loading