René's URL Explorer Experiment


Title: Python: taint is lost through list.extend, list.insert and += , but not list.append · Issue #22305 · github/codeql · GitHub

Open Graph Title: Python: taint is lost through list.extend, list.insert and += , but not list.append · Issue #22305 · github/codeql

X Title: Python: taint is lost through list.extend, list.insert and += , but not list.append · Issue #22305 · github/codeql

Description: Summary CodeQL's Python taint tracking propagates through list.append, but not through list.extend, list.insert, or += on a list. A security query therefore reports a flow written one way and stays silent on the same flow written another...

Open Graph Description: Summary CodeQL's Python taint tracking propagates through list.append, but not through list.extend, list.insert, or += on a list. A security query therefore reports a flow written one way and stays...

X Description: Summary CodeQL's Python taint tracking propagates through list.append, but not through list.extend, list.insert, or += on a list. A security query therefore reports a flow written one way and s...

Opengraph URL: https://github.com/github/codeql/issues/22305

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python: taint is lost through list.extend, list.insert and += , but not list.append","articleBody":"### Summary\n\nCodeQL's Python taint tracking propagates through `list.append`, but not through `list.extend`, `list.insert`, or `+=` on a list. A security query therefore reports a flow written one way and stays silent on the same flow written another way, where the two differ only in which list-mutation method is used.\n\nI'm reporting the **asymmetry** rather than the incompleteness: `append` is clearly modelled, so the other three look like a gap in the same model rather than a deliberate boundary.\n\n### Reproducer\n\nEach snippet is the same flow — a request parameter reaching `subprocess.call(..., shell=True)` — differing only in how the value passes through a list.\n\n```python\n# reported\ndef handler():\n    user = request.args.get(\"cmd\")\n    acc = [user]\n    subprocess.call(acc[0], shell=True)\n\n# reported\ndef handler():\n    user = request.args.get(\"cmd\")\n    acc = []\n    acc.append(user)\n    subprocess.call(acc[0], shell=True)\n\n# NOT reported\ndef handler():\n    user = request.args.get(\"cmd\")\n    acc = []\n    acc.extend([user])\n    subprocess.call(acc[0], shell=True)\n\n# NOT reported\ndef handler():\n    user = request.args.get(\"cmd\")\n    acc = []\n    acc.insert(0, user)\n    subprocess.call(acc[0], shell=True)\n\n# NOT reported\ndef handler():\n    user = request.args.get(\"cmd\")\n    acc = []\n    acc += [user]\n    subprocess.call(acc[0], shell=True)\n```\n\n### Results\n\n`codeql database analyze \u003cdb> codeql/python-queries:Security/CWE-078/CommandInjection.ql`\n\n| construct | reported |\n|---|---|\n| `acc = [user]` | yes |\n| `acc.append(user)` | yes |\n| `acc.extend([user])` | **no** |\n| `acc.extend(other)` where `other = [user]` | **no** |\n| `acc.extend([user])` then `for x in acc:` | **no** |\n| `acc.insert(0, user)` | **no** |\n| `acc += [user]` | **no** |\n\n### Environment\n\n- CodeQL CLI **2.26.2** (bundle `codeql-bundle-osx64`), macOS arm64\n- query: shipped `Security/CWE-078/CommandInjection.ql`, unmodified\n- the same asymmetry appears with `Security/CWE-022/PathInjection.ql` and `Security/CWE-089/SqlInjection.ql`\n\n### Controls\n\n- `acc = [user]` and `acc.append(user)` **are** reported, so the query, source and sink all work on these files.\n- A variant where the value comes from a local constant instead of `request.args` is **not** reported, so the rule is source-dependent rather than firing on shape.\n- All files were present in the database source archive, so the silences are misses rather than unanalysed files.\n\n### Note\n\n`append` in Go is tracked as #14116. This is the Python analogue for the other three mutation forms.\n","author":{"url":"https://github.com/espressolee","@type":"Person","name":"espressolee"},"datePublished":"2026-08-10T01:47:23Z","url":"https://github.com/github/codeql/issues/22305"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c1bd5c38-3cf8-02a4-3a20-5283f0148b9f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE5AE:2284D2:58E28C:7B5728:6AF85841
html-safe-nonce49d264d69d5c7564321c6e0968f4ce88dafa78b976a0f34a0171f4206234c248
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUFFOjIyODREMjo1OEUyOEM6N0I1NzI4OjZBRjg1ODQxIiwidmlzaXRvcl9pZCI6IjgyMTcwNDkwNDY0MzkxODg1NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb79687cae25e6e3578a8d9bf756555d16ac2f6aea0a800e6a7b9e7e6543a807e
hovercard-subject-tagissue:5105857350
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/github/codeql/22305/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c21c9a4ea962968c2ca8f8eef068b924b6cbba14a96a3df6e09a2b5d1f35111a/github/codeql/issues/22305
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c21c9a4ea962968c2ca8f8eef068b924b6cbba14a96a3df6e09a2b5d1f35111a/github/codeql/issues/22305
og:image:altSummary CodeQL's Python taint tracking propagates through list.append, but not through list.extend, list.insert, or += on a list. A security query therefore reports a flow written one way and stays...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameespressolee
hostnamegithub.com
expected-hostnamegithub.com
None5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db
turbo-cache-controlno-preview
go-importgithub.com/github/codeql git https://github.com/github/codeql.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id143040428
octolytics-dimension-repository_nwogithub/codeql
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id143040428
octolytics-dimension-repository_network_root_nwogithub/codeql
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
release653be32ff5c755082a4db662491bfbbcfc9112c1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/github/codeql/issues/22305#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fissues%2F22305
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%2Fgithub%2Fcodeql%2Fissues%2F22305
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=github%2Fcodeql
Reloadhttps://github.com/github/codeql/issues/22305
Reloadhttps://github.com/github/codeql/issues/22305
Reloadhttps://github.com/github/codeql/issues/22305
githubhttps://github.com/github
codeqlhttps://github.com/github/codeql
Codehttps://github.com/github/codeql
Issues1k (1k)https://github.com/github/codeql/issues
Pull requests516 (516)https://github.com/github/codeql/pulls
Discussionshttps://github.com/github/codeql/discussions
Actionshttps://github.com/github/codeql/actions
Projectshttps://github.com/github/codeql/projects
Security and qualityhttps://github.com/github/codeql/security
Insightshttps://github.com/github/codeql/pulse
https://github.com/github/codeql
New issuehttps://github.com/login?return_to=https://github.com/github/codeql/issues/22305
New issuehttps://github.com/login?return_to=https://github.com/github/codeql/issues/22305
#22310https://github.com/github/codeql/pull/22310
Python: taint is lost through list.extend, list.insert and += , but not list.appendhttps://github.com/github/codeql/issues/22305#top
#22310https://github.com/github/codeql/pull/22310
https://github.com/hvitved
https://github.com/copilot-swe-agent
https://github.com/espressolee
espressoleehttps://github.com/espressolee
on Aug 10, 2026https://github.com/github/codeql/issues/22305#issue-5105857350
#14116https://github.com/github/codeql/issues/14116
hvitvedhttps://github.com/hvitved
Copilothttps://github.com/apps/copilot-swe-agent
hvitvedhttps://github.com/hvitved
on Aug 10, 2026https://github.com/github/codeql/issues/22305#event-29223448347
Copilothttps://github.com/apps/copilot-swe-agent
Python: Add taint flow through list.extend and list.insert #22310https://github.com/github/codeql/pull/22310
on Aug 10, 2026https://github.com/github/codeql/issues/22305#event-29223461386
https://github.com/hvitved
hvitvedhttps://github.com/hvitved
on Aug 10, 2026https://github.com/github/codeql/issues/22305#issuecomment-5240674895
hvitvedhttps://github.com/hvitved
completedhttps://github.com/github/codeql/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 13, 2026https://github.com/github/codeql/issues/22305#event-29407928374
hvitvedhttps://github.com/hvitved
on Aug 13, 2026https://github.com/github/codeql/issues/22305#event-29407945751
hvitvedhttps://github.com/hvitved
completedhttps://github.com/github/codeql/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#22310https://github.com/github/codeql/pull/22310
on Aug 20, 2026https://github.com/github/codeql/issues/22305#event-29738399424
Sign up for freehttps://github.com/signup?return_to=https://github.com/github/codeql/issues/22305
Sign in to commenthttps://github.com/login?return_to=https://github.com/github/codeql/issues/22305
Copilothttps://github.com/apps/copilot-swe-agent
hvitvedhttps://github.com/hvitved
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.