GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.11] gh-90949: expose Expat API to tune exponential expansion protections (GH-139368) (GH-151401) by StanFromIreland · Pull Request #155346 · python/cpython

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented Aug 7, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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)

  • Issue: Expose Expat XML attack protection APIs #90949

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StanFromIreland @picnixz
[3.11] pythongh-90949: expose Expat API to tune exponential expansion…
17b0b06
… protections (pythonGH-139368) (pythonGH-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 <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
@StanFromIreland StanFromIreland assigned pablogsal Aug 7, 2026
This was referenced Aug 7, 2026
Expose Expat XML attack protection APIs #90949
Closed
[3.12] gh-90949: expose Expat API to tune exponential expansion protections (GH-139368) #151401
Merged
@bedevere-app bedevere-app Bot added the awaiting core review label Aug 7, 2026
@StanFromIreland

StanFromIreland commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

The only conflict was in the generated AC.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland
Fix capi member access
bdd44c2
@read-the-docs-community

read-the-docs-community Bot commented Aug 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33961346 | 📁 Comparing 17b0b06 against main (82905dd)

  🔍 Preview build  

568 files changed · + 18 added · ± 475 modified · - 75 deleted

+ Added

  • c-api/objbuffer.html
  • distutils/_setuptools_disclaimer.html
  • distutils/apiref.html
  • distutils/builtdist.html
  • distutils/commandref.html
  • distutils/configfile.html
  • distutils/examples.html
  • distutils/extending.html
  • distutils/index.html
  • distutils/introduction.html
  • and 8 more...

± Modified

  • about.html
  • bugs.html
  • copyright.html
  • glossary.html
  • index.html
  • license.html
  • py-modindex.html
  • search.html
  • c-api/abstract.html
  • c-api/allocation.html
  • and 465 more...

- Deleted

  • 404.html
  • improve-page-nojs.html
  • improve-page.html
  • _static/tachyon-example-flamegraph.html
  • _static/tachyon-example-heatmap.html
  • c-api/curses.html
  • c-api/extension-modules.html
  • c-api/interp-lifecycle.html
  • c-api/lifecycle.html
  • c-api/monitoring.html
  • and 65 more...
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal
pablogsal merged commit 3c1801a into python:3.11 Aug 9, 2026
33 of 37 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Aug 9, 2026
@StanFromIreland
StanFromIreland deleted the backport-db195e3-3.11 branch August 9, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@pablogsal pablogsal

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@StanFromIreland @pablogsal
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.