René's URL Explorer Experiment


Title: tar_filter behavior with links outside the destination is not clearly documented · Issue #158970 · python/cpython · GitHub

Open Graph Title: tar_filter behavior with links outside the destination is not clearly documented · Issue #158970 · python/cpython

X Title: tar_filter behavior with links outside the destination is not clearly documented · Issue #158970 · python/cpython

Description: Bug report The tar extraction filter allows archive members to create hard links or symbolic links that point outside the extraction directory. I understand from the security response that this is intentional, mainly to allow things such...

Open Graph Description: Bug report The tar extraction filter allows archive members to create hard links or symbolic links that point outside the extraction directory. I understand from the security response that this is ...

X Description: Bug report The tar extraction filter allows archive members to create hard links or symbolic links that point outside the extraction directory. I understand from the security response that this is ...

Opengraph URL: https://github.com/python/cpython/issues/158970

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tar_filter behavior with links outside the destination is not clearly documented","articleBody":"### Bug report\n\nThe `tar` extraction filter allows archive members to create hard links or symbolic links that point outside the extraction directory.\n\nI understand from the security response that this is intentional, mainly to allow things such as `/dev/null` and other system paths. However, I think the current documentation does not make the security implications of this behavior clear enough.\n\nThe documentation for `tar_filter` currently describes it as refusing to extract files whose absolute path, after following symlinks, would end up outside the destination. This can be easy to interpret as meaning that links themselves are restricted to the extraction directory.\n\nFor example, an archive can contain a hard link with an absolute target such as:\n\n```text\n/home/user/example\n```\n\nWhen extracted with:\n\n```python\ntar.extractall(destination, filter=\"tar\")\n```\n\nthe hard link can point to the existing file outside `destination`.\n\nThis is different from the behavior of the `data` filter, which rejects links that point outside the destination.\n\nI think the `tar_filter` documentation should explicitly state that:\n\n* Links are allowed to point outside the extraction directory.\n* This includes both absolute and relative link targets where applicable.\n* Extracting an untrusted archive with `filter=\"tar\"` may therefore create links to files outside the extraction directory.\n* Applications that need to safely extract untrusted archives should use the `data` filter instead.\n\nSomething along those lines would make the distinction between `tar` and `data` much harder to misunderstand.\n\n### Why this matters\n\nAn application developer may reasonably assume that using `filter=\"tar\"` provides a strong boundary around the extraction directory, especially because the documentation discusses preventing files from ending up outside the destination.\n\nExplicitly documenting that external links are intentionally permitted would make the behavior much clearer and help prevent applications from using the wrong filter for untrusted archives.\n\nI can provide a minimal reproducer showing the behavior if useful.\n\n### CPython versions tested on:\n\n3.12, 3.13, 3.14, CPython main branch\n\n### Operating systems tested on:\n\nLinux","author":{"url":"https://github.com/gpt4omni","@type":"Person","name":"gpt4omni"},"datePublished":"2026-10-07T14:44:39Z","url":"https://github.com/python/cpython/issues/158970"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:df082662-7115-9a5e-c88d-df0c6b7e260f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB4B0:2C4BED:4A78A8A:5E4F219:6B0253E1
html-safe-nonce55ad482d41e641373a4694a56991eeb5b25eb0549e74361cb671e4d8bc187291
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNEIwOjJDNEJFRDo0QTc4QThBOjVFNEYyMTk6NkIwMjUzRTEiLCJ2aXNpdG9yX2lkIjoiODYyNTA2MDE1NDg5Njk2MjUyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacab454d13e58598fbd956c0f8fc56da0d3493a48b935dbcde4064f28380dc09ec
hovercard-subject-tagissue:5746939065
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/158970/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fa7ead14c165660574968ae38faa4688d7623177c1d2fbe065468bf360a71c1b/python/cpython/issues/158970
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fa7ead14c165660574968ae38faa4688d7623177c1d2fbe065468bf360a71c1b/python/cpython/issues/158970
og:image:altBug report The tar extraction filter allows archive members to create hard links or symbolic links that point outside the extraction directory. I understand from the security response that this is ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegpt4omni
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/158970#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F158970
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F158970
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/158970
Reloadhttps://github.com/python/cpython/issues/158970
Reloadhttps://github.com/python/cpython/issues/158970
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/158970
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/158970
tar_filter behavior with links outside the destination is not clearly documentedhttps://github.com/python/cpython/issues/158970#top
https://github.com/encukou
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
https://github.com/gpt4omni
gpt4omnihttps://github.com/gpt4omni
on Oct 7, 2026https://github.com/python/cpython/issues/158970#issue-5746939065
gpt4omnihttps://github.com/gpt4omni
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Oct 7, 2026https://github.com/python/cpython/issues/158970#event-32699807436
picnixzhttps://github.com/picnixz
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Oct 7, 2026https://github.com/python/cpython/issues/158970#event-32700010621
github-project-automationhttps://github.com/apps/github-project-automation
docs issueshttps://github.com/orgs/python/projects/52
on Oct 7, 2026https://github.com/python/cpython/issues/158970#event-32818713756
github-project-automationhttps://github.com/apps/github-project-automation
docs issueshttps://github.com/orgs/python/projects/52
on Oct 7, 2026https://github.com/python/cpython/issues/158970
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 7, 2026https://github.com/python/cpython/issues/158970#issuecomment-6040471131
@encukouhttps://github.com/encukou
https://github.com/gpt4omni
gpt4omnihttps://github.com/gpt4omni
on Oct 7, 2026https://github.com/python/cpython/issues/158970#issuecomment-6040915301
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 7, 2026https://github.com/python/cpython/issues/158970#issuecomment-6041069863
encukouhttps://github.com/encukou
on Oct 7, 2026https://github.com/python/cpython/issues/158970#event-32702818318
StanFromIrelandhttps://github.com/StanFromIreland
Tarfile issues 🗄️https://github.com/orgs/python/projects/11
on Oct 7, 2026https://github.com/python/cpython/issues/158970#event-32980520504
StanFromIrelandhttps://github.com/StanFromIreland
duplicatehttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Aduplicate
Doc/library/tarfile.rst: document that the 'tar' extraction filter does not bound link targets #156026https://github.com/python/cpython/issues/156026
on Oct 7, 2026https://github.com/python/cpython/issues/158970#event-32726146897
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/158970
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/158970
encukouhttps://github.com/encukou
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
Tarfile issues 🗄️https://github.com/orgs/python/projects/11
docs issueshttps://github.com/orgs/python/projects/52
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.