René's URL Explorer Experiment


Title: Python: Unexpected flow from RemoteFlowSource · github/codeql · Discussion #5589 · GitHub

Open Graph Title: Python: Unexpected flow from RemoteFlowSource · github/codeql · Discussion #5589

X Title: Python: Unexpected flow from RemoteFlowSource · github/codeql · Discussion #5589

Description: Python: Unexpected flow from RemoteFlowSource

Open Graph Description: I'm working with a fairly easy flow, where the source is RemoteFlowSource and the sinks are both unsafe_dn and unsafe_filter. @app.route("/normal") def normal(): unsafe_dn = "dc=%s" % request.args[...

X Description: I'm working with a fairly easy flow, where the source is RemoteFlowSource and the sinks are both unsafe_dn and unsafe_filter. @app.route("/normal") def normal(): unsafe_dn = "dc=...

Opengraph URL: https://github.com/github/codeql/discussions/5589

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Python: Unexpected flow from RemoteFlowSource","text":"\u003cp dir=\"auto\"\u003eI'm working with a fairly easy flow, where the \u003ccode class=\"notranslate\"\u003esource\u003c/code\u003e is \u003ccode class=\"notranslate\"\u003eRemoteFlowSource\u003c/code\u003e and the sinks are both \u003ccode class=\"notranslate\"\u003eunsafe_dn\u003c/code\u003e and \u003ccode class=\"notranslate\"\u003eunsafe_filter\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"@app.route(\u0026quot;/normal\u0026quot;)\ndef normal():\n    unsafe_dn = \u0026quot;dc=%s\u0026quot; % request.args['dc']\n    unsafe_filter = \u0026quot;(user=%s)\u0026quot; % request.args['username']\n\n    srv = ldap3.Server('ldap://127.0.0.1', port=1337)\n    conn = ldap3.Connection(srv, user=unsafe_dn, auto_bind=True)\n    conn.search(unsafe_dn, unsafe_filter, attributes=[\n                \u0026quot;testAttr1\u0026quot;, \u0026quot;testAttr2\u0026quot;])\"\u003e\u003cpre class=\"notranslate\"\u003e\u003cspan class=\"pl-en\"\u003e@\u003cspan class=\"pl-s1\"\u003eapp\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eroute\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\"/normal\"\u003c/span\u003e)\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003edef\u003c/span\u003e \u003cspan class=\"pl-en\"\u003enormal\u003c/span\u003e():\n    \u003cspan class=\"pl-s1\"\u003eunsafe_dn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\"dc=%s\"\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e%\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003erequest\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eargs\u003c/span\u003e[\u003cspan class=\"pl-s\"\u003e'dc'\u003c/span\u003e]\n    \u003cspan class=\"pl-s1\"\u003eunsafe_filter\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\"(user=%s)\"\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e%\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003erequest\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eargs\u003c/span\u003e[\u003cspan class=\"pl-s\"\u003e'username'\u003c/span\u003e]\n\n    \u003cspan class=\"pl-s1\"\u003esrv\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eldap3\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eServer\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e'ldap://127.0.0.1'\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eport\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1337\u003c/span\u003e)\n    \u003cspan class=\"pl-s1\"\u003econn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eldap3\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eConnection\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003esrv\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003euser\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003eunsafe_dn\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eauto_bind\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eTrue\u003c/span\u003e)\n    \u003cspan class=\"pl-s1\"\u003econn\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003esearch\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eunsafe_dn\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eunsafe_filter\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eattributes\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e[\n                \u003cspan class=\"pl-s\"\u003e\"testAttr1\"\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"testAttr2\"\u003c/span\u003e])\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe thing is that, I get three different flows. The first one is the intended one (\u003ccode class=\"notranslate\"\u003erequest\u003c/code\u003e(l.3) -\u0026gt; \u003ccode class=\"notranslate\"\u003erequest.args\u003c/code\u003e(l3) -\u0026gt; \u003ccode class=\"notranslate\"\u003erequest.args['dc']\u003c/code\u003e(l.3) -\u0026gt; \u003ccode class=\"notranslate\"\u003eunsafe_dn\u003c/code\u003e), but the other ones are related to \u003ccode class=\"notranslate\"\u003eunsafe_filter\u003c/code\u003e and make some strange jumps (\u003ccode class=\"notranslate\"\u003erequest\u003c/code\u003e(l.9) directly jumps to \u003ccode class=\"notranslate\"\u003erequest.args\u003c/code\u003e(l.10) \u0026amp; \u003ccode class=\"notranslate\"\u003erequest\u003c/code\u003e(l.9) -\u0026gt;\u003ccode class=\"notranslate\"\u003erequest\u003c/code\u003e(l.10)).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://user-images.githubusercontent.com/46056498/113349610-9e680180-9338-11eb-967e-955dcab99e6b.png\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/46056498/113349610-9e680180-9338-11eb-967e-955dcab99e6b.png\" alt=\"image\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eI guess \u003ca href=\"https://github.com/github/codeql/pull/5443#discussion_r605207553\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/github/codeql/pull/5443/hovercard\"\u003ethis comment\u003c/a\u003e is also related to this issue.\u003cbr\u003e\nComplete unit tests and query: \u003ca class=\"issue-link js-issue-link\" data-error-text=\"Failed to load title\" data-id=\"835026063\" data-permission-text=\"Title is private\" data-url=\"https://github.com/github/codeql/issues/5443\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/github/codeql/pull/5443/hovercard\" href=\"https://github.com/github/codeql/pull/5443\"\u003e#5443\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThanks in advance for your time! :D\u003c/p\u003e","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"\u003cp dir=\"auto\"\u003eI think that \u003ccode class=\"notranslate\"\u003erequest\u003c/code\u003e (l.9) -\u0026gt; \u003ccode class=\"notranslate\"\u003erequest\u003c/code\u003e (l.10) (in the third path explanation) is use-use flow. That is, the reference to \u003ccode class=\"notranslate\"\u003erequest\u003c/code\u003e on line 10 is \"the next use\" of that variable after the reference on line 9. Use-use flow is normally compressed out of the path explanations, but it may be shown here because we force is to show all subscript reads. However, it seems to also give you the version where it is compressed away in the second path explanation.\u003c/p\u003e","upvoteCount":1,"url":"https://github.com/github/codeql/discussions/5589#discussioncomment-573179"}}}

route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:dd00a756-8a0c-7afa-fb1f-9cc2c35167f7
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-id8886:25A137:88B0BF:BF19C6:6A4C97DD
html-safe-nonce150eeb14dba9c6df5f7c8d1ffb22b1121370d694c169b95e639b2ca7fe403e50
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODg2OjI1QTEzNzo4OEIwQkY6QkYxOUM2OjZBNEM5N0REIiwidmlzaXRvcl9pZCI6IjI5NzI4MjkyNTcxNDk3NDkyMTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca954c2be2d40a5de2480b98d329b57d7e198130a89fdd0f3064a85fde6fc5cb6
hovercard-subject-tagdiscussion:3303093
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/github/codeql/5589/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/734f2e2d01776c6c94aaa04cfbee707fb3cf62102ec147a22d78d9407d85c637/github/codeql/discussions/5589
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/734f2e2d01776c6c94aaa04cfbee707fb3cf62102ec147a22d78d9407d85c637/github/codeql/discussions/5589
og:image:altI'm working with a fairly easy flow, where the source is RemoteFlowSource and the sinks are both unsafe_dn and unsafe_filter. @app.route("/normal") def normal(): unsafe_dn = "dc=%s" % request.args[...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c
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
release7a2dede45637df6b92ddcfe2a557e67d4b5854ae
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql/discussions/5589#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fdiscussions%2F5589
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fdiscussions%2F5589
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=github%2Fcodeql
Reloadhttps://github.com/github/codeql/discussions/5589
Reloadhttps://github.com/github/codeql/discussions/5589
Reloadhttps://github.com/github/codeql/discussions/5589
Please reload this pagehttps://github.com/github/codeql/discussions/5589
github https://github.com/github
codeqlhttps://github.com/github/codeql
Notifications https://github.com/login?return_to=%2Fgithub%2Fcodeql
Fork 2k https://github.com/login?return_to=%2Fgithub%2Fcodeql
Star 9.8k https://github.com/login?return_to=%2Fgithub%2Fcodeql
Code https://github.com/github/codeql
Issues 987 https://github.com/github/codeql/issues
Pull requests 424 https://github.com/github/codeql/pulls
Discussions https://github.com/github/codeql/discussions
Actions https://github.com/github/codeql/actions
Projects https://github.com/github/codeql/projects
Models https://github.com/github/codeql/models
Security and quality 0 https://github.com/github/codeql/security
Insights https://github.com/github/codeql/pulse
Code https://github.com/github/codeql
Issues https://github.com/github/codeql/issues
Pull requests https://github.com/github/codeql/pulls
Discussions https://github.com/github/codeql/discussions
Actions https://github.com/github/codeql/actions
Projects https://github.com/github/codeql/projects
Models https://github.com/github/codeql/models
Security and quality https://github.com/github/codeql/security
Insights https://github.com/github/codeql/pulse
Answered https://github.com/github/codeql/discussions/5589#discussioncomment-573179
yoffhttps://github.com/yoff
jorgectf https://github.com/jorgectf
Q&Ahttps://github.com/github/codeql/discussions/categories/q-a
Python: Unexpected flow from RemoteFlowSource https://github.com/github/codeql/discussions/5589#top
jorgectf https://github.com/jorgectf
Answered https://github.com/github/codeql/discussions/5589#discussioncomment-573179
yoffhttps://github.com/yoff
Return to tophttps://github.com/github/codeql/discussions/5589#top
Please reload this pagehttps://github.com/github/codeql/discussions/5589
https://github.com/github/codeql/discussions/5589
jorgectf https://github.com/jorgectf
Apr 1, 2021 https://github.com/github/codeql/discussions/5589#discussion-3303093
https://user-images.githubusercontent.com/46056498/113349610-9e680180-9338-11eb-967e-955dcab99e6b.png
this commenthttps://github.com/github/codeql/pull/5443#discussion_r605207553
#5443https://github.com/github/codeql/pull/5443
Give feedback.https://github.com/github/codeql/discussions/5589
yoff https://github.com/yoff
Apr 6, 2021 https://github.com/github/codeql/discussions/5589#discussioncomment-573179
View full answer https://github.com/github/codeql/discussions/5589#discussioncomment-573179
Oldest https://github.com/github/codeql/discussions/5589?sort=old
Newest https://github.com/github/codeql/discussions/5589?sort=new
Top https://github.com/github/codeql/discussions/5589?sort=top
Please reload this pagehttps://github.com/github/codeql/discussions/5589
https://github.com/github/codeql/discussions/5589
yoff https://github.com/yoff
Apr 6, 2021 https://github.com/github/codeql/discussions/5589#discussioncomment-573179
Give feedback.https://github.com/github/codeql/discussions/5589
https://github.com/jorgectf
Please reload this pagehttps://github.com/github/codeql/discussions/5589
https://github.com/github/codeql/discussions/5589
jorgectfhttps://github.com/jorgectf
Apr 6, 2021 https://github.com/github/codeql/discussions/5589#discussioncomment-574320
@yoffhttps://github.com/yoff
Give feedback.https://github.com/github/codeql/discussions/5589
https://github.com/yoff
Please reload this pagehttps://github.com/github/codeql/discussions/5589
https://github.com/github/codeql/discussions/5589
yoffhttps://github.com/yoff
Apr 6, 2021 https://github.com/github/codeql/discussions/5589#discussioncomment-575692
Give feedback.https://github.com/github/codeql/discussions/5589
https://github.com/jorgectf
Please reload this pagehttps://github.com/github/codeql/discussions/5589
https://github.com/github/codeql/discussions/5589
jorgectfhttps://github.com/jorgectf
Apr 6, 2021 https://github.com/github/codeql/discussions/5589#discussioncomment-575779
@yoffhttps://github.com/yoff
Give feedback.https://github.com/github/codeql/discussions/5589
https://github.com/jorgectf
Please reload this pagehttps://github.com/github/codeql/discussions/5589
https://github.com/github/codeql/discussions/5589
jorgectfhttps://github.com/jorgectf
Apr 6, 2021 https://github.com/github/codeql/discussions/5589#discussioncomment-575786
Give feedback.https://github.com/github/codeql/discussions/5589
https://github.com/yoff
Please reload this pagehttps://github.com/github/codeql/discussions/5589
https://github.com/github/codeql/discussions/5589
yoffhttps://github.com/yoff
Apr 6, 2021 https://github.com/github/codeql/discussions/5589#discussioncomment-575794
Give feedback.https://github.com/github/codeql/discussions/5589
jorgectfhttps://github.com/jorgectf
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fdiscussions%2F5589
🙏 Q&A https://github.com/github/codeql/discussions/categories/q-a
https://github.com/jorgectf
https://github.com/yoff
https://github.com/github/codeql/discussions/5589
https://github.com/settings/replies?return_to=1
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.