◐ Shell
reader mode source ↗
Skip to content

bpo-17239: Disable external entities in SAX parser#9217

Merged
miss-islington merged 1 commit into
python:masterfrom
tiran:bpo17239-sax-ges
Sep 23, 2018
Merged

bpo-17239: Disable external entities in SAX parser#9217
miss-islington merged 1 commit into
python:masterfrom
tiran:bpo17239-sax-ges

Conversation

@tiran

@tiran tiran commented Sep 12, 2018

Copy link
Copy Markdown
Member

The SAX parser no longer processes general external entities by default
to increase security. Before, the parser created network connections
to fetch remote files or loaded local files from the file system for DTD
and entities.

Signed-off-by: Christian Heimes christian@python.org

https://bugs.python.org/issue17239

@csabella

Copy link
Copy Markdown
Contributor

Since default functionality is changing, should this be included in the What's New in 3.8 page?

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

LGTM. Since there is a way to enable it in Python 3.7 and older, it's fine to change the default.

Should we change the default in Python 3.7 and older? I'm not sure about that.

@zooba zooba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

Agreed with both Cheryl and Victor's suggestions.

@tiran tiran force-pushed the bpo17239-sax-ges branch 2 times, most recently from 15bf855 to dd8ee7e Compare September 17, 2018 21:34
@tiran

tiran commented Sep 17, 2018

Copy link
Copy Markdown
Member Author

@csabella @vstinner @zooba I have updated the PR.

@zooba

zooba commented Sep 17, 2018

Copy link
Copy Markdown
Member

LGTM

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

LGTM, but maybe remove version numbers until they are really fixed?

@tiran tiran force-pushed the bpo17239-sax-ges branch 3 times, most recently from d8125c2 to 55db8ce Compare September 22, 2018 05:57
The xml.sax and xml.dom.minidom parsers no longer processes external
entities to increase security. Before, the parser created network
connections to fetch remote files or loaded local files from the file
system for DTD and entities.

Signed-off-by: Christian Heimes <christian@python.org>
@miss-islington

Copy link
Copy Markdown
Contributor

@tiran: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 17b1d5d into python:master Sep 23, 2018
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6, 3.7.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @tiran, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 17b1d5d4e36aa57a9b25a0e694affbd1ee637e45 3.7

@miss-islington miss-islington self-assigned this Sep 23, 2018
@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @tiran, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 17b1d5d4e36aa57a9b25a0e694affbd1ee637e45 3.6

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @tiran, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 17b1d5d4e36aa57a9b25a0e694affbd1ee637e45 2.7

@bedevere-bot

Copy link
Copy Markdown

GH-9511 is a backport of this pull request to the 3.7 branch.

tiran added a commit to tiran/cpython that referenced this pull request Sep 23, 2018
The SAX parser no longer processes general external entities by default
to increase security. Before, the parser created network connections
to fetch remote files or loaded local files from the file system for DTD
and entities.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue17239.
(cherry picked from commit 17b1d5d)

Co-authored-by: Christian Heimes <christian@python.org>
tiran added a commit to tiran/cpython that referenced this pull request Sep 23, 2018
The SAX parser no longer processes general external entities by default
to increase security. Before, the parser created network connections
to fetch remote files or loaded local files from the file system for DTD
and entities.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue17239.
(cherry picked from commit 17b1d5d)

Co-authored-by: Christian Heimes <christian@python.org>
@bedevere-bot

Copy link
Copy Markdown

GH-9512 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit that referenced this pull request Sep 24, 2018
…H-9512)

The SAX parser no longer processes general external entities by default
to increase security. Before, the parser created network connections
to fetch remote files or loaded local files from the file system for DTD
and entities.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue17239.
(cherry picked from commit 17b1d5d)

Co-authored-by: Christian Heimes <christian@python.org>



https://bugs.python.org/issue17239
miss-islington pushed a commit that referenced this pull request Sep 24, 2018
…H-9511)

The SAX parser no longer processes general external entities by default
to increase security. Before, the parser created network connections
to fetch remote files or loaded local files from the file system for DTD
and entities.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue17239.
(cherry picked from commit 17b1d5d)

Co-authored-by: Christian Heimes <christian@python.org>



https://bugs.python.org/issue17239
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-security A security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants