René's URL Explorer Experiment


Title: Golang : Add Query To Detect PAM Authorization Bugs · Pull Request #709 · github/codeql-go · GitHub

Open Graph Title: Golang : Add Query To Detect PAM Authorization Bugs · Pull Request #709 · github/codeql-go

X Title: Golang : Add Query To Detect PAM Authorization Bugs · Pull Request #709 · github/codeql-go

Description: Using merely pam_authneticate call to grant access to a user can cause security issue. The pam_authenticate call only checks if the username and the password match. It does not check if the account is expired. Hence, a user with an expired login or an expired password can still login. This issue is fairly common and was recently found in gogs/gogs and go-gitea/gitea. In this case, the bugs were assigned CVE-2022-0871 and CVE-2022-0905 respectively. This PR aims to detect instances were an initiated PAM Transaction invokes the Authenticate method but does not invoke a call to the AcctMgmt method. Due to the nature of the query, I don't expect that may FP's or FN's. There could some unwanted alerts due to test code but to avoid that I filter out all file paths which have test in them. With this PR, I submit two queries, one using local data flow and the other using global taint flow. The global taint flow one should be more precise but may have a performance penalty while the other local flow one may lead to FN's but should be faster to execute. A quick run of both these queries on roughly 17 projects can be found in the LGTM runs below. global taint flow local data flow All of the results appear to be correct. The runs also includes two projects procupineyhairs/gogs_pam and porcupineyhairs/gitea_pam. These are vulnerable versions of the projects mentioned above. The alerts show a valid detection of the CVE. No alerts for the gogs and gitea projects shows detection of the patch correcting the bug. I am also working on two more PR's for C and Python respectively which detect the same underlying issue.

Open Graph Description: Using merely pam_authneticate call to grant access to a user can cause security issue. The pam_authenticate call only checks if the username and the password match. It does not check if the account...

X Description: Using merely pam_authneticate call to grant access to a user can cause security issue. The pam_authenticate call only checks if the username and the password match. It does not check if the account...

Opengraph URL: https://github.com/github/codeql-go/pull/709

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2f477401-3f61-3c68-eba5-467596d4ad2d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCA70:A3B49:EC95DB:143DCB1:6A4D5E25
html-safe-nonce1f09449b1203be4947d78b3645f13e23fd45b586aab52d01d9bb0201c529b228
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTcwOkEzQjQ5OkVDOTVEQjoxNDNEQ0IxOjZBNEQ1RTI1IiwidmlzaXRvcl9pZCI6Ijc2NTYwODI5NzI3NjA0MzIxNjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1e845d47abdfe5bf602af849505d9e042f34b00186e5262692ffb47ab1d30562
hovercard-subject-tagpull_request:892867005
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/codeql-go/pull/709/files
twitter:imagehttps://avatars.githubusercontent.com/u/10137?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10137?s=400&v=4
og:image:altUsing merely pam_authneticate call to grant access to a user can cause security issue. The pam_authenticate call only checks if the username and the password match. It does not check if the account...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonee6658d7c7808aeed776f841e0839b885fce343c9b96244be612c779298e7661e
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/codeql-go git https://github.com/github/codeql-go.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id218150891
octolytics-dimension-repository_nwogithub/codeql-go
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id218150891
octolytics-dimension-repository_network_root_nwogithub/codeql-go
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea438513d3a22ffcd713795ed948c3e5525007665
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql-go/pull/709/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql-go%2Fpull%2F709%2Ffiles
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-go%2Fpull%2F709%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fcodeql-go
Reloadhttps://github.com/github/codeql-go/pull/709/files
Reloadhttps://github.com/github/codeql-go/pull/709/files
Reloadhttps://github.com/github/codeql-go/pull/709/files
Please reload this pagehttps://github.com/github/codeql-go/pull/709/files
github https://github.com/github
codeql-gohttps://github.com/github/codeql-go
Notifications https://github.com/login?return_to=%2Fgithub%2Fcodeql-go
Fork 128 https://github.com/login?return_to=%2Fgithub%2Fcodeql-go
Star 470 https://github.com/login?return_to=%2Fgithub%2Fcodeql-go
Code https://github.com/github/codeql-go
Issues 1 https://github.com/github/codeql-go/issues
Pull requests 6 https://github.com/github/codeql-go/pulls
Actions https://github.com/github/codeql-go/actions
Projects https://github.com/github/codeql-go/projects
Models https://github.com/github/codeql-go/models
Security and quality 0 https://github.com/github/codeql-go/security
Insights https://github.com/github/codeql-go/pulse
Code https://github.com/github/codeql-go
Issues https://github.com/github/codeql-go/issues
Pull requests https://github.com/github/codeql-go/pulls
Actions https://github.com/github/codeql-go/actions
Projects https://github.com/github/codeql-go/projects
Models https://github.com/github/codeql-go/models
Security and quality https://github.com/github/codeql-go/security
Insights https://github.com/github/codeql-go/pulse
ghosthttps://github.com/ghost
github:mainhttps://github.com/github/codeql-go/tree/main
Conversation 7 https://github.com/github/codeql-go/pull/709
Findings https://github.com/github/codeql-go/pull/709/findings
Commits 1 https://github.com/github/codeql-go/pull/709/commits
Checks 0 https://github.com/github/codeql-go/pull/709/checks
Files changed https://github.com/github/codeql-go/pull/709/files
Please reload this pagehttps://github.com/github/codeql-go/pull/709/files
Golang : Add Query To Detect PAM Authorization Bugs https://github.com/github/codeql-go/pull/709/files#top
Show all changes 1 commit https://github.com/github/codeql-go/pull/709/files
1264180 Golang : Add Query To Detect PAM Authorization Bugs Mar 29, 2022 https://github.com/github/codeql-go/pull/709/commits/1264180503ee3e1a7add3420e8d7faae67b2fef3
Clear filters https://github.com/github/codeql-go/pull/709/files
Please reload this pagehttps://github.com/github/codeql-go/pull/709/files
Please reload this pagehttps://github.com/github/codeql-go/pull/709/files
PamAuthBypass.ql https://github.com/github/codeql-go/pull/709/files#diff-7dd4cbba0ced3be6482be143cd2493f2641d464c16a79b815f16bfbb95330b69
PamAuthBypassLocal.ql https://github.com/github/codeql-go/pull/709/files#diff-f39b5b0071a9d0cf7cae0ade77b00863609b08a68ea3794b53a8d69ec2a36e50
PamAuthBypass.expected https://github.com/github/codeql-go/pull/709/files#diff-ecf8e95a2991bd26dc86e954a181b195c48159ef302269e7357b4c8883fed10b
PamAuthBypass.qlref https://github.com/github/codeql-go/pull/709/files#diff-f3f1690963028ae04a1132b809e47f47e71710dc536d249d3cab630ad79d99b6
go.mod https://github.com/github/codeql-go/pull/709/files#diff-fb609b271561ae69e39a07a606b0376ce1016b580082da885c0f7665af637e64
main.go https://github.com/github/codeql-go/pull/709/files#diff-e618e2509abb5e7ad387f58bea6cbcbcf6f9e9c92e680098130bff04bb5c36a3
stub.go https://github.com/github/codeql-go/pull/709/files#diff-de2308124a98097e5ec4473f0b642f7aa4292be21378243a9927e68e3cd6c1c0
modules.txt https://github.com/github/codeql-go/pull/709/files#diff-998272631b1318369641021f4c596020ae8d4ee1f7795008a7e532dba8f76d01
https://github.com/github/codeql-go/blob/main/CODEOWNERS#L1
ql/src/experimental/CWE-285/PamAuthBypass.qlhttps://github.com/github/codeql-go/pull/709/files#diff-7dd4cbba0ced3be6482be143cd2493f2641d464c16a79b815f16bfbb95330b69
View file https://github.com/github/codeql-go/blob/1264180503ee3e1a7add3420e8d7faae67b2fef3/ql/src/experimental/CWE-285/PamAuthBypass.ql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-go/pull/709/{{ revealButtonHref }}
Please reload this pagehttps://github.com/github/codeql-go/pull/709/files
Please reload this pagehttps://github.com/github/codeql-go/pull/709/files
https://github.com/github/codeql-go/blob/main/CODEOWNERS#L1
ql/src/experimental/CWE-285/PamAuthBypassLocal.qlhttps://github.com/github/codeql-go/pull/709/files#diff-f39b5b0071a9d0cf7cae0ade77b00863609b08a68ea3794b53a8d69ec2a36e50
View file https://github.com/github/codeql-go/blob/1264180503ee3e1a7add3420e8d7faae67b2fef3/ql/src/experimental/CWE-285/PamAuthBypassLocal.ql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-go/pull/709/{{ revealButtonHref }}
smowtonhttps://github.com/smowton
May 30, 2022https://github.com/github/codeql-go/pull/709/files#r885037953
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/github/codeql-go/pull/709/files
ghosthttps://github.com/ghost
May 30, 2022https://github.com/github/codeql-go/pull/709/files#r885048561
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/github/codeql-go/pull/709/files
https://github.com/github/codeql-go/blob/main/CODEOWNERS#L1
ql/test/experimental/CWE-285/PamAuthBypass.expectedhttps://github.com/github/codeql-go/pull/709/files#diff-ecf8e95a2991bd26dc86e954a181b195c48159ef302269e7357b4c8883fed10b
View file https://github.com/github/codeql-go/blob/1264180503ee3e1a7add3420e8d7faae67b2fef3/ql/test/experimental/CWE-285/PamAuthBypass.expected
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-go/pull/709/{{ revealButtonHref }}
https://github.com/github/codeql-go/blob/main/CODEOWNERS#L1
ql/test/experimental/CWE-285/PamAuthBypass.qlrefhttps://github.com/github/codeql-go/pull/709/files#diff-f3f1690963028ae04a1132b809e47f47e71710dc536d249d3cab630ad79d99b6
View file https://github.com/github/codeql-go/blob/1264180503ee3e1a7add3420e8d7faae67b2fef3/ql/test/experimental/CWE-285/PamAuthBypass.qlref
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-go/pull/709/{{ revealButtonHref }}
https://github.com/github/codeql-go/blob/main/CODEOWNERS#L1
ql/test/experimental/CWE-285/go.modhttps://github.com/github/codeql-go/pull/709/files#diff-fb609b271561ae69e39a07a606b0376ce1016b580082da885c0f7665af637e64
View file https://github.com/github/codeql-go/blob/1264180503ee3e1a7add3420e8d7faae67b2fef3/ql/test/experimental/CWE-285/go.mod
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-go/pull/709/{{ revealButtonHref }}
https://github.com/github/codeql-go/blob/main/CODEOWNERS#L1
ql/test/experimental/CWE-285/main.gohttps://github.com/github/codeql-go/pull/709/files#diff-e618e2509abb5e7ad387f58bea6cbcbcf6f9e9c92e680098130bff04bb5c36a3
View file https://github.com/github/codeql-go/blob/1264180503ee3e1a7add3420e8d7faae67b2fef3/ql/test/experimental/CWE-285/main.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-go/pull/709/{{ revealButtonHref }}
https://github.com/github/codeql-go/blob/main/CODEOWNERS#L1
ql/test/experimental/CWE-285/vendor/github.com/msteinert/pam/stub.gohttps://github.com/github/codeql-go/pull/709/files#diff-de2308124a98097e5ec4473f0b642f7aa4292be21378243a9927e68e3cd6c1c0
View file https://github.com/github/codeql-go/blob/1264180503ee3e1a7add3420e8d7faae67b2fef3/ql/test/experimental/CWE-285/vendor/github.com/msteinert/pam/stub.go
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/github/codeql-go/pull/709/files
https://github.com/github/codeql-go/blob/main/CODEOWNERS#L1
ql/test/experimental/CWE-285/vendor/modules.txthttps://github.com/github/codeql-go/pull/709/files#diff-998272631b1318369641021f4c596020ae8d4ee1f7795008a7e532dba8f76d01
View file https://github.com/github/codeql-go/blob/1264180503ee3e1a7add3420e8d7faae67b2fef3/ql/test/experimental/CWE-285/vendor/modules.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-go/pull/709/{{ revealButtonHref }}
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.