Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-127502: Update XML vulnerability table#135294

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
vstinner wants to merge4 commits intopython:main
base:main
Choose a base branch
Loading
fromvstinner:xml_safe

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedJun 9, 2025
edited by github-actionsbot
Loading

Python 3.11-3.15 include expat 2.7.1 which is not vulnerable.

expat 2.6.0 was released in February 2024.


📚 Documentation preview 📚:https://cpython-previews--135294.org.readthedocs.build/

Python 3.11-3.15 include expat 2.7.1 which is not vulnerable.expat 2.6.0 was released in February 2024.
@encukou
Copy link
Member

Do you think the table should be kept, now that it saysSafe almost everywhere?

@vstinner
Copy link
MemberAuthor

Do you think the table should be kept, now that it says Safe almost everywhere?

The table has many notes with pyexpat versions. There are likely old Python versions in the wild with old pyexat versions.

The question is more if we need to keep the big red warning at the top:

The XML modules are not secure against erroneous or maliciously constructed data. If you need to parse untrusted or unauthenticated data see the XML vulnerabilities and The defusedxml Package sections.

Maybe this warning can just be removed.

Since Python XML modules are now safe by default, we can maybe remove references to the defusedxml project which is no longer needed.

Note: The latest defused version (0.7.0) was released in 2021. There is a 0.8.0rc2 version around since September 2023 with no final release. The project seems to be unmaintained (latest commit: 2 years ago).

@vstinner
Copy link
MemberAuthor

I updated my PR to remove the red warning and remove references to defusedxml.

@hannob
Copy link

There are similar warnings in several other files, e.g.:

Doc/library/xml.etree.elementtree.rstDoc/library/xml.dom.pulldom.rstDoc/library/xml.dom.minidom.rstDoc/library/xml.sax.rst

Replace also "XML Vulnerabilities" with "XML Security".
@vstinner
Copy link
MemberAuthor

There are similar warnings in several other files

Good catch. I replaced most warnings with notes. I replaced also "XML Vulnerabilities" with "XML Security".

I kept the warnings for XML-RPC client and server since the XML table still says that XML-RPC is vulnerable to decompression bomb.

@encukou
Copy link
Member

The table has many notes with pyexpat versions. There are likely old Python versions in the wild with old pyexat versions.

So maybe the whole table, and the list of vulnerabilities, could be replaced with something like: “Expat versions lower that 2.6.0 may be vulnerable to :cve:xxx-xxx and :cve:xxx-xxx. Python may be vulnerable if it uses such older versions of Expat as a system-provided library, it may be vulnerable. Check :const:!pyexpat.EXPAT_VERSION.”
and maybe a link to defusedxml for details?

@sethmlarson, is it OK to remove the note “The XML processing modules arenot secure against maliciously constructed data”, if allknown vulnerabilities are fixed?

shihai1991 reacted with thumbs up emoji

@vstinner
Copy link
MemberAuthor

On Linux, Python is usually linked to the system expat library, and so we don't control the expat version. For this reason, I would prefer to keep the table for now. The table contains a lot of information and has many notes.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
awaiting core reviewdocsDocumentation in the Doc dirneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixesskip news
Projects
Status: Todo
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@vstinner@encukou@hannob

[8]ページ先頭

©2009-2025 Movatter.jp