| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
I've updated the PR from the web UI but I'll do the rest tomorrow.
Sorry, something went wrong.
There was a problem hiding this comment.
@picnixz I like this new version! 👍
One question: There were changes in here to the previous related news file. This is what it reads on main today:
# cat Misc/NEWS.d/next/Library/2025-09-22-14-40-11.gh-issue-90949.UM35nb.rst
Add :meth:`~xml.parsers.expat.xmlparser.SetAllocTrackerActivationThreshold`
and :meth:`~xml.parsers.expat.xmlparser.SetAllocTrackerMaximumAmplification`
to :ref:`xmlparser <xmlparser-objects>` objects to prevent use of
disproportional amounts of dynamic memory from within an Expat parser.
Patch by Bénédikt Tran.From what we discussed here, this should probably says things about tuning also?
Should you or me create a follow-up pull request to adjust that after this?
Sorry, something went wrong.
|
I'll amend the NEWS as part of this PR. |
Sorry, something went wrong.
|
Since this is built on top of many other PRs, I'll just wait for the others to be backported first. |
Sorry, something went wrong.
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, something went wrong.
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
|
Sorry, @picnixz, I could not cleanly backport this to 3.10 due to a conflict. cherry_picker 666112376d574c7802646ee1df6244062671cd61 3.10 |
Sorry, something went wrong.
|
Sorry, @picnixz, I could not cleanly backport this to 3.11 due to a conflict. cherry_picker 666112376d574c7802646ee1df6244062671cd61 3.11 |
Sorry, something went wrong.
|
Sorry, @picnixz, I could not cleanly backport this to 3.12 due to a conflict. cherry_picker 666112376d574c7802646ee1df6244062671cd61 3.12 |
Sorry, something went wrong.
|
Sorry, @picnixz, I could not cleanly backport this to 3.13 due to a conflict. cherry_picker 666112376d574c7802646ee1df6244062671cd61 3.13 |
Sorry, something went wrong.
|
Sorry, @picnixz, I could not cleanly backport this to 3.14 due to a conflict. cherry_picker 666112376d574c7802646ee1df6244062671cd61 3.14 |
Sorry, something went wrong.
|
@StanFromIreland I see that the backports here totally failed and then it passed under my radar. Could you backport this PR (and any other PRs that need to be backported with it, including docs changes) to 3.14 so that you're no more blocked? I'm sorry to dump my work on you but I won't be available otherwise for that today :( |
Sorry, something went wrong.
|
It's fine, I've put it on my list, I'll get to it soon-ish. |
Sorry, something went wrong.
| disproportional amounts of dynamic memory usage from within an Expat parser. | ||
| (Contributed by Bénédikt Tran in :gh:`90949`.) | ||
|
|
||
| * Add :meth:`~xml.parsers.expat.xmlparser.SetBillionLaughsAttackProtectionActivationThreshold` |
There was a problem hiding this comment.
I'm not quite sure how to go about backporting this, I think we'll need to remove it from here?
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, you can drop this part in older branches but we still want the versionadded:: next in the docs directly. What's New can be omitted. You can add the explicit Python version when it was added though (3.14.x) and not just 3.14 (don't know if :: next handles it...)
Sorry, something went wrong.
… protections (pythonGH-139368) Expose the XML Expat 2.7.2 APIs to tune protections against "billion laughs" [1] attacks. The exposed APIs are available on Expat parsers, that is, parsers created by `xml.parsers.expat.ParserCreate()`, as: - `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and - `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`. This completes the work in f04bea4, and improves the existing related documentation. [1]: https://en.wikipedia.org/wiki/Billion_laughs_attack (cherry picked from commit 6661123) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-150496 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
…ctions (GH-139368) (#150496) Expose the XML Expat 2.7.2 APIs to tune protections against "billion laughs" [1] attacks. The exposed APIs are available on Expat parsers, that is, parsers created by `xml.parsers.expat.ParserCreate()`, as: - `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and - `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`. This completes the work in f04bea4, and improves the existing related documentation. [1]: https://en.wikipedia.org/wiki/Billion_laughs_attack (cherry picked from commit 6661123) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-151151 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
…ctions (GH-139368) Expose the XML Expat 2.7.2 APIs to tune protections against "billion laughs" [1] attacks. The exposed APIs are available on Expat parsers, that is, parsers created by `xml.parsers.expat.ParserCreate()`, as: - `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and - `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`. This completes the work in f04bea4, and improves the existing related documentation. [1]: https://en.wikipedia.org/wiki/Billion_laughs_attack (cherry picked from commit 6661123) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-151401 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
…ctions (GH-139368) (#151401) Expose the XML Expat 2.7.2 APIs to tune protections against "billion laughs" [1] attacks. The exposed APIs are available on Expat parsers, that is, parsers created by `xml.parsers.expat.ParserCreate()`, as: - `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and - `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`. This completes the work in f04bea4, and improves the existing related documentation. [1]: https://en.wikipedia.org/wiki/Billion_laughs_attack (cherry picked from commit 6661123) (cherry picked from commit 19bc391) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…ctions (GH-139368) (GH-151401) (#155346) * [3.11] gh-90949: expose Expat API to tune exponential expansion protections (GH-139368) (GH-151401) Expose the XML Expat 2.7.2 APIs to tune protections against "billion laughs" [1] attacks. The exposed APIs are available on Expat parsers, that is, parsers created by `xml.parsers.expat.ParserCreate()`, as: - `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and - `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`. This completes the work in f04bea4, and improves the existing related documentation. [1]: https://en.wikipedia.org/wiki/Billion_laughs_attack (cherry picked from commit 6661123) (cherry picked from commit 19bc391) (cherry picked from commit db195e3) Co-authored-by: Stan Ulbrych <stan@python.org> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> * Fix capi member access --------- Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…ctions (GH-139368) (#151401) (#155414) Expose the XML Expat 2.7.2 APIs to tune protections against "billion laughs" [1] attacks. The exposed APIs are available on Expat parsers, that is, parsers created by `xml.parsers.expat.ParserCreate()`, as: - `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and - `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`. This completes the work in f04bea4, and improves the existing related documentation. [1]: https://en.wikipedia.org/wiki/Billion_laughs_attack (cherry picked from commit 6661123) (cherry picked from commit 19bc391) (cherry picked from commit db195e3) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
This is built on top of #139366.
cc @hartwork
📚 Documentation preview 📚: https://cpython-previews--139368.org.readthedocs.build/