Title: Possible resource exhaustation of `expandvars` in `Tools/freeze/checkextensions.py` · Issue #136073 · python/cpython · GitHub
Open Graph Title: Possible resource exhaustation of `expandvars` in `Tools/freeze/checkextensions.py` · Issue #136073 · python/cpython
X Title: Possible resource exhaustation of `expandvars` in `Tools/freeze/checkextensions.py` · Issue #136073 · python/cpython
Description: Bug Description: The code will re-scan the newly generated content after replacing the variable. If a variable is defined to contain itself (i.e., a recursive definition), this process will fall into infinite recursion. This recursion ca...
Open Graph Description: Bug Description: The code will re-scan the newly generated content after replacing the variable. If a variable is defined to contain itself (i.e., a recursive definition), this process will fall in...
X Description: Bug Description: The code will re-scan the newly generated content after replacing the variable. If a variable is defined to contain itself (i.e., a recursive definition), this process will fall in...
Opengraph URL: https://github.com/python/cpython/issues/136073
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Possible resource exhaustation of `expandvars` in `Tools/freeze/checkextensions.py`","articleBody":"**Bug Description:**\nThe code will re-scan the newly generated content after replacing the variable. If a variable is defined to contain itself (i.e., a recursive definition), this process will fall into infinite recursion.\n\nThis recursion can lead to two forms of attacks: one is to cause an infinite loop and deplete CPU resources, and the other is to cause the string to grow infinitely and deplete memory resources. The final result will all lead to the application crashing or being unresponsive.\n\n**Vulnerability Locations :**\n1.https://github.com/python/cpython/blob/e64395e8eb8d3a9e35e3e534e87d427ff27ab0a5/Tools/freeze/checkextensions.py#L72\n\n**Repair Status:**\nNone\n\n**Common Information:**\n* **CPython Version:** main branch\n* **Operating System:** Linux\n* **Credits:** Finder is kexinoh (Xiangfan Wu) from QI-ANXIN Technology Research Institute. \n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-136093\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/kexinoh","@type":"Person","name":"kexinoh"},"datePublished":"2025-06-28T12:31:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/136073/cpython/issues/136073"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:df0d9f2e-7efd-a284-257e-819d81bc7c7c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DFD4:E8423:2A3495E:37AF805:696B2B41 |
| html-safe-nonce | bb580ba8868e141bb8ffd7737762640ba11b30847aa2332110f8fa555ee336d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERkQ0OkU4NDIzOjJBMzQ5NUU6MzdBRjgwNTo2OTZCMkI0MSIsInZpc2l0b3JfaWQiOiI4NzEzMDA5ODY2NjM3NzgxODI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f9c26a67938022113ba0740bfc260cbc8b5304b0addcba30a5b4ee561f5d3f7b |
| hovercard-subject-tag | issue:3184913365 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/136073/issue_layout |
| twitter:image | https://opengraph.githubassets.com/11b2e185b8668bba751a16706c246699650670809e00f4d0d887d47817496609/python/cpython/issues/136073 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/11b2e185b8668bba751a16706c246699650670809e00f4d0d887d47817496609/python/cpython/issues/136073 |
| og:image:alt | Bug Description: The code will re-scan the newly generated content after replacing the variable. If a variable is defined to contain itself (i.e., a recursive definition), this process will fall in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kexinoh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width