René's URL Explorer Experiment


Title: [Java] CWE-295 - Incorrect Hostname Verification by intrigus-lgtm · Pull Request #3581 · github/codeql · GitHub

Open Graph Title: [Java] CWE-295 - Incorrect Hostname Verification by intrigus-lgtm · Pull Request #3581 · github/codeql

X Title: [Java] CWE-295 - Incorrect Hostname Verification by intrigus-lgtm · Pull Request #3581 · github/codeql

Description: Hostname verification is an essential part of Transport Layer Security (TLS) and HTTPS. When a TLS connection is established there are two important steps: First, the chain of trust is verified that means it is checked whether the certificate has been issued by a trusted certificate authority. Second, the hostname (that is being connected to) needs to be verified against the certificate. That means it is checked whether the certificate is actually for the hostname. If the hostname is not verified an attacker could present any certificate with a valid chain of trust, but that is not issued for the hostname at all. Many posts tell developers that have problems with hostname verification to accept any certificate as valid in the case of a mismatch. These problems usually are configuration problems that should be fixed instead. Java verifies HTTPS hostname by default when using URL/HttpsUrlConnection. But when a protocol uses TLS (SSLEngine/SSLSocket) directly, the hostname is not verified by default. That's where the second part of my query (IncorrectHostnameVerifier.ql) comes into play. [This PR and PR description is WIP] [I've also noticed #3550, which seems to focus on the chain of trust vaildation]

Open Graph Description: Hostname verification is an essential part of Transport Layer Security (TLS) and HTTPS. When a TLS connection is established there are two important steps: First, the chain of trust is verified tha...

X Description: Hostname verification is an essential part of Transport Layer Security (TLS) and HTTPS. When a TLS connection is established there are two important steps: First, the chain of trust is verified tha...

Opengraph URL: https://github.com/github/codeql/pull/3581

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6db285fb-dc96-727c-ec8b-03d7d720dbb8
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD194:391DC1:1476195:1D9792B:6A4CE2A6
html-safe-nonceb03873088bcdbd4760d9f987540560363f597d8cb3dbd788bc2ec72476bb23ab
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTk0OjM5MURDMToxNDc2MTk1OjFEOTc5MkI6NkE0Q0UyQTYiLCJ2aXNpdG9yX2lkIjoiMzcwNzc4NjU4MTk4NzA5MTExMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfaf6a28ab03e6a2e6aeef81c7423d8deb3f34b94206ea759730113ec6f755d90
hovercard-subject-tagpull_request:424114020
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/pull/3581/files
twitter:imagehttps://avatars.githubusercontent.com/u/60750685?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/60750685?s=400&v=4
og:image:altHostname verification is an essential part of Transport Layer Security (TLS) and HTTPS. When a TLS connection is established there are two important steps: First, the chain of trust is verified tha...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None299b43bca6e02ad35197ffeba30d2466846d5fb02ab96fbced5b5e6cec589fb8
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec5a57f04eeb310f57c73fd6d751d957e2ca27ed2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql/pull/3581/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fpull%2F3581%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%2Fpull%2F3581%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
Reloadhttps://github.com/github/codeql/pull/3581/files
Reloadhttps://github.com/github/codeql/pull/3581/files
Reloadhttps://github.com/github/codeql/pull/3581/files
Please reload this pagehttps://github.com/github/codeql/pull/3581/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
intrigus-lgtmhttps://github.com/intrigus-lgtm
github:mainhttps://github.com/github/codeql/tree/main
intrigus-lgtm:java-hostname-verifier-cwe-295https://github.com/intrigus-lgtm/ql/tree/java-hostname-verifier-cwe-295
Conversation 17 https://github.com/github/codeql/pull/3581
Findings https://github.com/github/codeql/pull/3581/findings
Commits 3 https://github.com/github/codeql/pull/3581/commits
Checks 0 https://github.com/github/codeql/pull/3581/checks
Files changed https://github.com/github/codeql/pull/3581/files
Please reload this pagehttps://github.com/github/codeql/pull/3581/files
[Java] CWE-295 - Incorrect Hostname Verification https://github.com/github/codeql/pull/3581/files#top
Show all changes 3 commits https://github.com/github/codeql/pull/3581/files
3f2e574 [Java] CWE-295 - Incorrect Hostname Verification intrigus Jun 1, 2020 https://github.com/github/codeql/pull/3581/commits/3f2e5749cd325050df0e5f923bb24b6d67b3c2a4
3f1d01d [Java] Add SSLSession Type intrigus Jun 1, 2020 https://github.com/github/codeql/pull/3581/commits/3f1d01df0d7afa50aaa4727b292cc3ff2ad781fd
f5d49b2 Temporary fix intrigus Jun 24, 2020 https://github.com/github/codeql/pull/3581/commits/f5d49b20b4dbd4ecdb2b6cfbbac84828bcdbd946
Clear filters https://github.com/github/codeql/pull/3581/files
Please reload this pagehttps://github.com/github/codeql/pull/3581/files
Please reload this pagehttps://github.com/github/codeql/pull/3581/files
AlwaysTrueHostnameVerifier.java https://github.com/github/codeql/pull/3581/files#diff-9a0ecea0691d64c5db2b45b59fde9dde0c6fafe3b73ce219ea3d0331011b365e
AndroidHostnameVerifier.LICENSE https://github.com/github/codeql/pull/3581/files#diff-40c220bb180ec4122da4b96b209a32133e61c26c1e9282a2e3cf8335280faab3
AndroidHostnameVerifier.java https://github.com/github/codeql/pull/3581/files#diff-734b01482d97228d94d545e07a374253a52f3cc6861540abfe1fecdd828fa024
EverythingAcceptingHostnameVerifier.qhelp https://github.com/github/codeql/pull/3581/files#diff-2d5fbeb29cd455f1c84862b38a2e62b0afd40dbc03595ef4819c2e902e6ecbe7
EverythingAcceptingHostnameVerifier.ql https://github.com/github/codeql/pull/3581/files#diff-f972ef59eb05e154461fc123a794d14c190fcdcaa0abc3df29b6f9995c0a14a6
HostnameValidation.qll https://github.com/github/codeql/pull/3581/files#diff-be3f6ce0f076e7fae466ab5d5490a8da17459fcc56d9909ab99fe30ce48288d1
IncorrectHostnameVerifier.qhelp https://github.com/github/codeql/pull/3581/files#diff-8e5921e2ae3cd10c76e339d51d16873c06d4533760c12a9f3c1241efa6015ea7
IncorrectHostnameVerifier.ql https://github.com/github/codeql/pull/3581/files#diff-51273e8c8a7581237fda835cda14f462438c8194bb177bbb12af3a2134a5ef86
LocalhostHostnameVerifier.java https://github.com/github/codeql/pull/3581/files#diff-5de04b452e5983b4c2b3c5a47adf2c12c4344f1994034cded4e83c7b77d5c860
PeerHostHostnameVerifier.java https://github.com/github/codeql/pull/3581/files#diff-9f89b48cf41a74946c6f44b0f0e64a4b38159cfb7dc74a6aa710b8f5c8be0cb8
RawSSLSocketEndpointIdentification.java https://github.com/github/codeql/pull/3581/files#diff-6adb33bfc28bdb5cfd08de871d96bb698342136eb087d3d83d300f3ab1fa8216
RawSSLSocketHostnameVerifierAndroid.java https://github.com/github/codeql/pull/3581/files#diff-add3c61fe29b5b4ef467d504f14bd1f8e6f8b6fe75731335674a92990f47289e
Encryption.qll https://github.com/github/codeql/pull/3581/files#diff-f1a339240c91ba2a65effe4a748c49f44108b0e302d93bcc37c51528abbf2dfc
EverythingAcceptingHostnameVerifier.expected https://github.com/github/codeql/pull/3581/files#diff-161b2813a7e67993b00d38219e6533f93725e027cd56000de74984e72bc2f17f
EverythingAcceptingHostnameVerifier.java https://github.com/github/codeql/pull/3581/files#diff-3215ecd96569412a19370ef35d45907c981aaddbb9b4de445b50a6ffd02209ad
EverythingAcceptingHostnameVerifier.qlref https://github.com/github/codeql/pull/3581/files#diff-e4bd48cc71749a3fd95cd23e702aa8664ae50da5ed2c77545883622f7ebac17d
IncorrectHostnameVerifier.expected https://github.com/github/codeql/pull/3581/files#diff-eb0ee54789d4426a6fe139b1e137b455dc8d2a0028117f1a3c22b7ef3c33c533
IncorrectHostnameVerifier.java https://github.com/github/codeql/pull/3581/files#diff-d5ec2b97ff9eb416ab9d7bcab1c9b00debc447615e5df24997088f1ffbcd4684
IncorrectHostnameVerifier.qlref https://github.com/github/codeql/pull/3581/files#diff-95800108a4c147ada019cb819b99517d91c019d0acdf34665d5ddbc09bc6030e
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-295/AlwaysTrueHostnameVerifier.javahttps://github.com/github/codeql/pull/3581/files#diff-9a0ecea0691d64c5db2b45b59fde9dde0c6fafe3b73ce219ea3d0331011b365e
View file https://github.com/intrigus-lgtm/ql/blob/f5d49b20b4dbd4ecdb2b6cfbbac84828bcdbd946/java/ql/src/experimental/Security/CWE/CWE-295/AlwaysTrueHostnameVerifier.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/3581/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-295/AndroidHostnameVerifier.LICENSEhttps://github.com/github/codeql/pull/3581/files#diff-40c220bb180ec4122da4b96b209a32133e61c26c1e9282a2e3cf8335280faab3
View file https://github.com/intrigus-lgtm/ql/blob/f5d49b20b4dbd4ecdb2b6cfbbac84828bcdbd946/java/ql/src/experimental/Security/CWE/CWE-295/AndroidHostnameVerifier.LICENSE
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/3581/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-295/AndroidHostnameVerifier.javahttps://github.com/github/codeql/pull/3581/files#diff-734b01482d97228d94d545e07a374253a52f3cc6861540abfe1fecdd828fa024
View file https://github.com/intrigus-lgtm/ql/blob/f5d49b20b4dbd4ecdb2b6cfbbac84828bcdbd946/java/ql/src/experimental/Security/CWE/CWE-295/AndroidHostnameVerifier.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/3581/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-295/EverythingAcceptingHostnameVerifier.qhelphttps://github.com/github/codeql/pull/3581/files#diff-2d5fbeb29cd455f1c84862b38a2e62b0afd40dbc03595ef4819c2e902e6ecbe7
View file https://github.com/intrigus-lgtm/ql/blob/f5d49b20b4dbd4ecdb2b6cfbbac84828bcdbd946/java/ql/src/experimental/Security/CWE/CWE-295/EverythingAcceptingHostnameVerifier.qhelp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/3581/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-295/EverythingAcceptingHostnameVerifier.qlhttps://github.com/github/codeql/pull/3581/files#diff-f972ef59eb05e154461fc123a794d14c190fcdcaa0abc3df29b6f9995c0a14a6
View file https://github.com/intrigus-lgtm/ql/blob/f5d49b20b4dbd4ecdb2b6cfbbac84828bcdbd946/java/ql/src/experimental/Security/CWE/CWE-295/EverythingAcceptingHostnameVerifier.ql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/3581/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-295/HostnameValidation.qllhttps://github.com/github/codeql/pull/3581/files#diff-be3f6ce0f076e7fae466ab5d5490a8da17459fcc56d9909ab99fe30ce48288d1
View file https://github.com/intrigus-lgtm/ql/blob/f5d49b20b4dbd4ecdb2b6cfbbac84828bcdbd946/java/ql/src/experimental/Security/CWE/CWE-295/HostnameValidation.qll
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/3581/{{ revealButtonHref }}
Please reload this pagehttps://github.com/github/codeql/pull/3581/files
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.