René's URL Explorer Experiment


Title: Quoted usernames are not supported · Issue #920 · utPLSQL/utPLSQL · GitHub

Open Graph Title: Quoted usernames are not supported · Issue #920 · utPLSQL/utPLSQL

X Title: Quoted usernames are not supported · Issue #920 · utPLSQL/utPLSQL

Description: Description An unfriendly DBA could inject SQL by creating a user. All parts building up a dynamic SQL or PL/SQL statements must be asserted accordingly. Even expressions like sys_context('userenv','current_schema'). Special thanks to @k...

Open Graph Description: Description An unfriendly DBA could inject SQL by creating a user. All parts building up a dynamic SQL or PL/SQL statements must be asserted accordingly. Even expressions like sys_context('userenv'...

X Description: Description An unfriendly DBA could inject SQL by creating a user. All parts building up a dynamic SQL or PL/SQL statements must be asserted accordingly. Even expressions like sys_context('user...

Opengraph URL: https://github.com/utPLSQL/utPLSQL/issues/920

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Quoted usernames are not supported","articleBody":"### Description\r\n\r\nAn unfriendly DBA could inject SQL by creating a user. All parts building up a dynamic SQL or PL/SQL statements must be asserted accordingly. Even expressions like `sys_context('userenv','current_schema')`. Special thanks to @krisrice for pointing that out.\r\n\r\n### utPLSQL Version\r\n\r\nv3.1.7.2808-develop\r\n\r\n### To Reproduce\r\n\r\n#### 1. Create user\r\n\r\n```\r\ncreate user \";drop table t;\" identified by \"demo\";\r\ngrant connect, resource to \";drop table t;\"\r\n```\r\n\r\n#### 2. Create test\r\n\r\n```\r\nconnect \";drop table emp;\"/demo\r\n\r\ncreate table t (c varchar2(10 char));\r\n\r\ncreate or replace package test_p is\r\n\r\n   --%suite\r\n\r\n   --%test\r\n   procedure p;\r\n   \r\nend test_p;\r\n/\r\n\r\ncreate or replace package body test_p is\r\n\r\n   procedure p is\r\n   begin\r\n      ut.expect(1).to_equal(1);\r\n   end p;\r\n   \r\nend test_p;\r\n/\r\n```\r\n\r\n### Run Test\r\n\r\n```\r\nset serveroutput on size unlimited\r\nexecute ut.run(ut_varchar2_list());\r\n```\r\n\r\nThe server output is: \r\n\r\n```\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_SUITE_MANAGER\", line 45\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_SUITE_MANAGER\", line 69\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_SUITE_MANAGER\", line 652\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_RUNNER\", line 136\r\n\r\nORA-20202: Invalid path format: ;drop table t;\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_SUITE_MANAGER\", line 45\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_SUITE_MANAGER\", line 69\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_SUITE_MANAGER\", line 652\r\n\r\n\r\n\r\nError starting at line : 2 in command -\r\nBEGIN ut.run(ut_varchar2_list()); END;\r\nError report -\r\nORA-20202: Invalid path format: ;drop table t;\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_RUNNER\", line 172\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_SUITE_MANAGER\", line 45\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_SUITE_MANAGER\", line 69\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_SUITE_MANAGER\", line 652\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT_RUNNER\", line 136\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT\", line 128\r\nORA-06512: at \"UT3_LATEST_RELEASE.UT\", line 465\r\nORA-06512: at line 1\r\n```\r\n\r\nIn this case the test just failed without side effects. However, it shows two things:\r\n\r\na) utPLSQL expects and supports certain style of usernames only (no enquoted user names)\r\n\r\nb) the potential risks of SQL injection.\r\n\r\n\r\n### Expected Behavior\r\n\r\nThe test case above works. 1 test executed successfully.\r\n\r\n\r\n### Additional Context\r\n\r\n@krisrice suggested to change the code in [ut_utils.pkb](https://github.com/utPLSQL/utPLSQL/blob/467078f121f2410638fc71ec7b81eed26bf38dd7/source/core/ut_utils.pkb#L550)\r\n\r\nfrom \r\n\r\n```\r\n  function ut_owner return varchar2 is\r\n  begin\r\n    return sys_context('userenv','current_schema');\r\n  end;\r\n```\r\n\r\nto \r\n\r\n```\r\n  function ut_owner return varchar2 is\r\n  begin\r\n    return sys.dbms_assert.enquote_name(sys_context('userenv','current_schema'));\r\n  end;\r\n```\r\n","author":{"url":"https://github.com/PhilippSalvisberg","@type":"Person","name":"PhilippSalvisberg"},"datePublished":"2019-05-11T16:08:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/920/utPLSQL/issues/920"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4984d3ca-24da-7440-2aee-38faf335bbef
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD174:20E33D:92B097:D1F118:6A6382B1
html-safe-nonceef00369c59182d80a73daf5da825ea287b33f1ab8642f6a9eb690089b8fb7bd4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTc0OjIwRTMzRDo5MkIwOTc6RDFGMTE4OjZBNjM4MkIxIiwidmlzaXRvcl9pZCI6IjM1Nzk0NDEzNDEyOTc1NTgxOTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6686cf913d347e2a04b0288649e4f09d3c81e3fb2cfda96143d4014ee01a52bc
hovercard-subject-tagissue:443010044
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/utPLSQL/utPLSQL/920/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6708c3070dc413e87dde3e9735365502c1535f24d8d0da95cb649a0f70adc844/utPLSQL/utPLSQL/issues/920
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6708c3070dc413e87dde3e9735365502c1535f24d8d0da95cb649a0f70adc844/utPLSQL/utPLSQL/issues/920
og:image:altDescription An unfriendly DBA could inject SQL by creating a user. All parts building up a dynamic SQL or PL/SQL statements must be asserted accordingly. Even expressions like sys_context('userenv'...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamePhilippSalvisberg
hostnamegithub.com
expected-hostnamegithub.com
Nonee4fb64aef87da454ec25b158147f7f5f14aef29216e5ca1612c2e48faa599d1f
turbo-cache-controlno-preview
go-importgithub.com/utPLSQL/utPLSQL git https://github.com/utPLSQL/utPLSQL.git
octolytics-dimension-user_id15661281
octolytics-dimension-user_loginutPLSQL
octolytics-dimension-repository_id50728220
octolytics-dimension-repository_nwoutPLSQL/utPLSQL
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id50728220
octolytics-dimension-repository_network_root_nwoutPLSQL/utPLSQL
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
releasee839936ba5faffb9c836dda1cf4729d50c88a32e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/utPLSQL/utPLSQL/issues/920#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FutPLSQL%2FutPLSQL%2Fissues%2F920
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/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/enterprise/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%2FutPLSQL%2FutPLSQL%2Fissues%2F920
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%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=utPLSQL%2FutPLSQL
Reloadhttps://github.com/utPLSQL/utPLSQL/issues/920
Reloadhttps://github.com/utPLSQL/utPLSQL/issues/920
Reloadhttps://github.com/utPLSQL/utPLSQL/issues/920
Please reload this pagehttps://github.com/utPLSQL/utPLSQL/issues/920
utPLSQL https://github.com/utPLSQL
utPLSQLhttps://github.com/utPLSQL/utPLSQL
Notifications https://github.com/login?return_to=%2FutPLSQL%2FutPLSQL
Fork 188 https://github.com/login?return_to=%2FutPLSQL%2FutPLSQL
Star 619 https://github.com/login?return_to=%2FutPLSQL%2FutPLSQL
Code https://github.com/utPLSQL/utPLSQL
Issues 12 https://github.com/utPLSQL/utPLSQL/issues
Pull requests 0 https://github.com/utPLSQL/utPLSQL/pulls
Discussions https://github.com/utPLSQL/utPLSQL/discussions
Actions https://github.com/utPLSQL/utPLSQL/actions
Projects https://github.com/utPLSQL/utPLSQL/projects
Security and quality 0 https://github.com/utPLSQL/utPLSQL/security
Insights https://github.com/utPLSQL/utPLSQL/pulse
Code https://github.com/utPLSQL/utPLSQL
Issues https://github.com/utPLSQL/utPLSQL/issues
Pull requests https://github.com/utPLSQL/utPLSQL/pulls
Discussions https://github.com/utPLSQL/utPLSQL/discussions
Actions https://github.com/utPLSQL/utPLSQL/actions
Projects https://github.com/utPLSQL/utPLSQL/projects
Security and quality https://github.com/utPLSQL/utPLSQL/security
Insights https://github.com/utPLSQL/utPLSQL/pulse
#988https://github.com/utPLSQL/utPLSQL/pull/988
Quoted usernames are not supportedhttps://github.com/utPLSQL/utPLSQL/issues/920#top
#988https://github.com/utPLSQL/utPLSQL/pull/988
bughttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22bug%22
securityhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22security%22
https://github.com/PhilippSalvisberg
PhilippSalvisberghttps://github.com/PhilippSalvisberg
on May 11, 2019https://github.com/utPLSQL/utPLSQL/issues/920#issue-443010044
@krisricehttps://github.com/krisrice
@krisricehttps://github.com/krisrice
ut_utils.pkbhttps://github.com/utPLSQL/utPLSQL/blob/467078f121f2410638fc71ec7b81eed26bf38dd7/source/core/ut_utils.pkb#L550
bughttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22bug%22
securityhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22security%22
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.