Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS "same origin" check is incorrect (ports + subdomains) #1490

Open
rexxars opened this issue Jul 20, 2024 · 0 comments
Open

CORS "same origin" check is incorrect (ports + subdomains) #1490

rexxars opened this issue Jul 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rexxars
Copy link
Contributor

rexxars commented Jul 20, 2024

Describe the bug
Determining if a request is cross-origin is currently implemented by checking the hostname of the current page and the remote URL. This is not in accordance with the specification, where the origin is considered to be scheme + domain + port. In addition, the check currently allows subdomains - which is also not in accordance with it.

To Reproduce
Steps to reproduce the behavior:

  1. Do a request from http://localhost:1234 to http://localhost:9876
  2. Request should have triggered cross-origin behavior (port differs), but currently does not
  3. Do a request from http://some.host to http://sub.some.host
  4. Request should have triggered cross-origin behavior (hostname differs), but currently does not

Expected behavior
Should follow browser behavior for cross-origin requests

@rexxars rexxars added the bug Something isn't working label Jul 20, 2024
@rexxars rexxars changed the title CORS "same origin" check is incorrect CORS "same origin" check is incorrect (ports + subdomains) Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant