Title: Rephrase ast.literal_eval() to remove any security warranty · Issue #95588 · python/cpython · GitHub
Open Graph Title: Rephrase ast.literal_eval() to remove any security warranty · Issue #95588 · python/cpython
X Title: Rephrase ast.literal_eval() to remove any security warranty · Issue #95588 · python/cpython
Description: Currently, ast.literal_eval() documentation gives multiple security warranties: Safely evaluate This can be used for safely evaluating strings containing Python values from untrusted sources IMO that's plain wrong if you read the followi...
Open Graph Description: Currently, ast.literal_eval() documentation gives multiple security warranties: Safely evaluate This can be used for safely evaluating strings containing Python values from untrusted sources IMO th...
X Description: Currently, ast.literal_eval() documentation gives multiple security warranties: Safely evaluate This can be used for safely evaluating strings containing Python values from untrusted sources IMO th...
Opengraph URL: https://github.com/python/cpython/issues/95588
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rephrase ast.literal_eval() to remove any security warranty","articleBody":"Currently, [ast.literal_eval() documentation](https://docs.python.org/dev/library/ast.html#ast.literal_eval) gives multiple security warranties:\r\n\r\n* **Safely** evaluate\r\n* This can be used for **safely** evaluating strings containing Python values from **untrusted sources**\r\n\r\nIMO that's plain wrong if you read the following RED WARNING:\r\n\r\n\u003e It is possible to **crash** the Python interpreter (...)\r\n\r\nThe documentation should be rephrased to only described the purpose of the function and make it very clear that it must NOT be used on untrusted sources.\r\n\r\nWe can follow the phrasing of the pickle documentation: https://docs.python.org/dev/library/pickle.html\r\n\r\n\u003e The pickle module is **not secure**. Only unpickle data you trust.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-126729\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2022-08-03T09:28:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":23},"url":"https://github.com/95588/cpython/issues/95588"}
| 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:67631eb8-26e7-139a-7756-e8517fbc840d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC68:24B4E0:35E5E3:48CCE3:6969ACCF |
| html-safe-nonce | e9441c01c37b01244abe62bb718894e546a6b2358cfb597cc0b8ed141971f5bd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzY4OjI0QjRFMDozNUU1RTM6NDhDQ0UzOjY5NjlBQ0NGIiwidmlzaXRvcl9pZCI6IjQ2NjA1OTQzNTQ2ODg3MzIzNjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4bf65783b215b5f2d7d91e17440ba77deaceca8d3893a151330b7c210b53c8e6 |
| hovercard-subject-tag | issue:1326934722 |
| 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/95588/issue_layout |
| twitter:image | https://opengraph.githubassets.com/710d4723c911fc3406dca382f7126fe0cf4b298f82367105006f4812c925595d/python/cpython/issues/95588 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/710d4723c911fc3406dca382f7126fe0cf4b298f82367105006f4812c925595d/python/cpython/issues/95588 |
| og:image:alt | Currently, ast.literal_eval() documentation gives multiple security warranties: Safely evaluate This can be used for safely evaluating strings containing Python values from untrusted sources IMO th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| 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 | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width