René's URL Explorer Experiment


Title: Account for hosts with/without ports in origin check · Issue #6166 · coder/code-server · GitHub

Open Graph Title: Account for hosts with/without ports in origin check · Issue #6166 · coder/code-server

X Title: Account for hosts with/without ports in origin check · Issue #6166 · coder/code-server

Description: Is there an existing issue for this? I have searched the existing issues OS/Web Information N/A Steps to Reproduce You can simulate with this NGINX config: proxy_set_header X-Forwarded-Host $host:$server_port; Expected If your origin is ...

Open Graph Description: Is there an existing issue for this? I have searched the existing issues OS/Web Information N/A Steps to Reproduce You can simulate with this NGINX config: proxy_set_header X-Forwarded-Host $host:$...

X Description: Is there an existing issue for this? I have searched the existing issues OS/Web Information N/A Steps to Reproduce You can simulate with this NGINX config: proxy_set_header X-Forwarded-Host $host:$...

Opengraph URL: https://github.com/coder/code-server/issues/6166

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Account for hosts with/without ports in origin check","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have searched the existing issues\r\n\r\n### OS/Web Information\r\n\r\nN/A\r\n\r\n### Steps to Reproduce\r\n\r\nYou can simulate with this NGINX config:\r\n\r\n```\r\nproxy_set_header X-Forwarded-Host $host:$server_port;\r\n```\r\n\r\n### Expected\r\n\r\nIf your origin is `https://domain.tld` and your host is `domain.tld:443` the check should pass.  Same for `http://domain.tld` and `domain.tld:80`.\r\n\r\nAlso I think NGINX's `$host` actually does not include ports so it will fail if your config only has `$host` and if you host on a port other than 443 and 80 since you would get an origin like `https://domain.tld:8080` and the host would be `domain.tld`.\r\n\r\nTo fix the first we could just check the protocol on the origin and then add/remove 443 or 80.\r\n\r\nFor the second we could ignore the port altogether since I think the vulnerability does not happen across ports...\r\n\r\nBut I am not sure we should do anything; maybe the correct course of action is to edit the proxy config so the host and origin headers match.  I have looked at other software but they all seem to do exact matches without messing around with the port.  We could just edit the documentation to use `$http_host`.\r\n\r\n### Actual\r\n\r\nThe origin and domain are matched exactly so they do not match.  Ends up causing the web sockets to fail with 1006.\r\n\r\n### Logs\r\n\r\n_No response_\r\n\r\n### Screenshot/Video\r\n\r\n_No response_\r\n\r\n### Does this issue happen in VS Code or GitHub Codespaces?\r\n\r\n- [X] I cannot reproduce this in VS Code.\r\n- [X] I cannot reproduce this in GitHub Codespaces.\r\n\r\n### Are you accessing code-server over HTTPS?\r\n\r\n- [X] I am using HTTPS.\r\n\r\n### Notes\r\n\r\nhttps://github.com/coder/code-server/issues/6161\r\n\r\nMight be causing issues reported in https://github.com/coder/code-server/issues/6023 and https://github.com/coder/code-server/issues/6064 as well.\r\n\r\nAnd possibly https://github.com/coder/code-server/issues/6014","author":{"url":"https://github.com/code-asher","@type":"Person","name":"code-asher"},"datePublished":"2023-04-24T18:58:48Z","url":"https://github.com/coder/code-server/issues/6166"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3462df05-c536-61f5-daa8-0274fe66b654
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id95EE:3F3939:D11BF6:124F891:6B043DFA
html-safe-nonce87ccc9f4bbbc36c2936302a8f1750cb0efc75550a46c7fb3fa1ba1efbc18a6be
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUVFOjNGMzkzOTpEMTFCRjY6MTI0Rjg5MTo2QjA0M0RGQSIsInZpc2l0b3JfaWQiOiIzMTMyMTUwMDc2ODY5NDU5NDUwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac1831b4565e5a9018900b28967b3ac03ee9bb02a963f4b8cf569311aa296121d3
hovercard-subject-tagissue:1681848013
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/coder/code-server/6166/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f2a41c59d9452cf2eb13b8aaa2c295603f0814431977d5c7de97225939b59dcf/coder/code-server/issues/6166
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f2a41c59d9452cf2eb13b8aaa2c295603f0814431977d5c7de97225939b59dcf/coder/code-server/issues/6166
og:image:altIs there an existing issue for this? I have searched the existing issues OS/Web Information N/A Steps to Reproduce You can simulate with this NGINX config: proxy_set_header X-Forwarded-Host $host:$...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecode-asher
hostnamegithub.com
expected-hostnamegithub.com
None9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64
turbo-cache-controlno-preview
go-importgithub.com/coder/code-server git https://github.com/coder/code-server.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id172953845
octolytics-dimension-repository_nwocoder/code-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id172953845
octolytics-dimension-repository_network_root_nwocoder/code-server
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
release06dc448a76fe4751ac1db26524aefa3aa3e889a8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/coder/code-server/issues/6166#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fissues%2F6166
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%2Fcoder%2Fcode-server%2Fissues%2F6166
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=coder%2Fcode-server
Reloadhttps://github.com/coder/code-server/issues/6166
Reloadhttps://github.com/coder/code-server/issues/6166
Reloadhttps://github.com/coder/code-server/issues/6166
coderhttps://github.com/coder
code-serverhttps://github.com/coder/code-server
Codehttps://github.com/coder/code-server
Issues147 (147)https://github.com/coder/code-server/issues
Pull requests15 (15)https://github.com/coder/code-server/pulls
Discussionshttps://github.com/coder/code-server/discussions
Actionshttps://github.com/coder/code-server/actions
Projectshttps://github.com/coder/code-server/projects
Security and quality3 (3)https://github.com/coder/code-server/security
Insightshttps://github.com/coder/code-server/insights
https://github.com/coder/code-server
New issuehttps://github.com/login?return_to=https://github.com/coder/code-server/issues/6166
New issuehttps://github.com/login?return_to=https://github.com/coder/code-server/issues/6166
#8059https://github.com/coder/code-server/pull/8059
Account for hosts with/without ports in origin checkhttps://github.com/coder/code-server/issues/6166#top
#8059https://github.com/coder/code-server/pull/8059
bugSomething isn't workinghttps://github.com/coder/code-server/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/code-asher
code-asherhttps://github.com/code-asher
on Apr 24, 2023https://github.com/coder/code-server/issues/6166#issue-1681848013
#6161https://github.com/coder/code-server/issues/6161
#6023https://github.com/coder/code-server/issues/6023
#6064https://github.com/coder/code-server/issues/6064
#6014https://github.com/coder/code-server/issues/6014
code-asherhttps://github.com/code-asher
bugSomething isn't workinghttps://github.com/coder/code-server/issues?q=state%3Aopen%20label%3A%22bug%22
triageThis issue needs to be triaged by a maintainerhttps://github.com/coder/code-server/issues?q=state%3Aopen%20label%3A%22triage%22
on Apr 24, 2023https://github.com/coder/code-server/issues/6166#event-9084824869
code-asherhttps://github.com/code-asher
on Apr 24, 2023https://github.com/coder/code-server/issues/6166#event-9084865067
code-asherhttps://github.com/code-asher
needs-decisionhttps://github.com/coder/code-server/issues?q=state%3Aopen%20label%3A%22needs-decision%22
triageThis issue needs to be triaged by a maintainerhttps://github.com/coder/code-server/issues?q=state%3Aopen%20label%3A%22triage%22
on Apr 24, 2023https://github.com/coder/code-server/issues/6166#event-9085051024
code-asherhttps://github.com/code-asher
on Apr 24, 2023https://github.com/coder/code-server/issues/6166#event-9085109200
code-asherhttps://github.com/code-asher
on Apr 24, 2023https://github.com/coder/code-server/issues/6166#event-9085109602
https://github.com/smerschjohann
smerschjohannhttps://github.com/smerschjohann
on May 10, 2023https://github.com/coder/code-server/issues/6166#issuecomment-1542157385
X-Forwarded-Hosthttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host
X-Forwarded-Protohttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto
https://github.com/code-asher
code-asherhttps://github.com/code-asher
on May 11, 2023https://github.com/coder/code-server/issues/6166#issuecomment-1544609687
code-asherhttps://github.com/code-asher
needs-decisionhttps://github.com/coder/code-server/issues?q=state%3Aopen%20label%3A%22needs-decision%22
on Jul 11, 2024https://github.com/coder/code-server/issues/6166#event-13479153352
code-asherhttps://github.com/code-asher
Fresh copy of code-server 4.98.2 fills the log with Content Security Policy error on Chrome #7285https://github.com/coder/code-server/issues/7285
on Apr 7, 2026https://github.com/coder/code-server/issues/6166#event-24270796384
https://github.com/harshbhx
harshbhxhttps://github.com/harshbhx
on Oct 14, 2026https://github.com/coder/code-server/issues/6166#issuecomment-6167530083
@code-asherhttps://github.com/code-asher
#8055https://github.com/coder/code-server/pull/8055
https://github.com/smerschjohann
smerschjohannhttps://github.com/smerschjohann
on Oct 14, 2026https://github.com/coder/code-server/issues/6166#issuecomment-6174736512
https://domain.tldhttps://domain.tld
https://domain.tld:443https://domain.tld:443
http://domain.tldhttp://domain.tld
http://doman.tld:80http://doman.tld:80
https://github.com/harshbhx
harshbhxhttps://github.com/harshbhx
on Oct 14, 2026https://github.com/coder/code-server/issues/6166#issuecomment-6179143064
@smerschjohannhttps://github.com/smerschjohann
@code-asherhttps://github.com/code-asher
https://github.com/code-asher
code-asherhttps://github.com/code-asher
on Oct 14, 2026https://github.com/coder/code-server/issues/6166#issuecomment-6179353282
harshbhxhttps://github.com/harshbhx
on Oct 15, 2026https://github.com/coder/code-server/issues/6166#event-33377362679
Normalize default ports and use X-Forwarded-Port in the origin checkhttps://github.com/harshbhx/code-server/commit/7e16bbf939435fe954560dcc0678a4765961e691
https://docs.github.com/articles/closing-issues-via-commit-messages
7e16bbfhttps://github.com/harshbhx/code-server/commit/7e16bbf939435fe954560dcc0678a4765961e691
code-asherhttps://github.com/code-asher
completedhttps://github.com/coder/code-server/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#8059https://github.com/coder/code-server/pull/8059
on Oct 27, 2026https://github.com/coder/code-server/issues/6166#event-34319066125
Sign up for freehttps://github.com/signup?return_to=https://github.com/coder/code-server/issues/6166
Sign in to commenthttps://github.com/login?return_to=https://github.com/coder/code-server/issues/6166
bugSomething isn't workinghttps://github.com/coder/code-server/issues?q=state%3Aopen%20label%3A%22bug%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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.