Skip to content

[Snyk] Security upgrade lxml from 4.9.2 to 6.1.0 - #59

Open
nlaurance wants to merge 1 commit into
masterfrom
snyk-fix-494484aa0d4dc22e4d081bac230e5d1d
Open

nlaurance wants to merge 1 commit into
masterfrom
snyk-fix-494484aa0d4dc22e4d081bac230e5d1d

Conversation

@nlaurance

Copy link
Copy Markdown
Owner

snyk-top-banner

Snyk has created this PR to fix 1 vulnerabilities in the pip dependencies of this project.

Snyk changed the following file(s):

  • requirements/main.txt

Breaking Change Risk

Merge Risk: High

Notice: This assessment is enhanced by AI.


Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.
  • Some vulnerabilities couldn't be fully fixed and so Snyk will still find them when the project is tested again. This may be because the vulnerability existed within more than one direct dependency, but not all of the affected dependencies could be upgraded.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 XML External Entity (XXE) Injection

The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-LXML-16119103
@nlaurance

Copy link
Copy Markdown
Owner Author

Merge Risk: High

This is a major version upgrade with significant breaking changes, including dropped support for older Python versions and important security-driven changes to default parser behavior.

Key Breaking Changes:

  • Python Version Requirement: Support for Python versions older than 3.8 has been removed. The previous version (4.9.2) supported Python 2.7 and 3.5+. You must be on Python 3.8 or newer to upgrade. [6]
  • External Entity (XXE) Processing Disabled by Default: To prevent XXE vulnerabilities, lxml 5.0 and later no longer resolve external entities by default. The resolve_entities parser option now defaults to 'internal'. This change was extended to iterparse and ETCompatXMLParser in version 6.1.0. [3, 7, 11]
  • Schematron Deprecation: The Schematron class is deprecated and is expected to be removed in a future version of lxml, as the underlying feature is being removed from the libxml2 library. [6]
  • HTML Parsing Behavior Change: When parsing HTML, tags containing a colon (e.g., <prefix:tag>) are now treated as a single tag name, which alters the behavior of element.find(). [3, 8]

Recommendation:

  • Verify Python Version: Ensure your environment runs Python 3.8 or newer.
  • Review XML Parsing: If your application processes XML with external entities, you must explicitly set resolve_entities=True in your parser to maintain the old behavior. This is a critical security-related change.
  • Check Schematron Usage: If you use lxml.etree.Schematron, be aware of its deprecation and plan for its eventual removal.

Source: lxml changelog

Notice 🤖: This content was augmented using artificial intelligence. AI-generated content may contain errors and should be reviewed for accuracy before use.

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