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

gateway: set CORS headers for browser support #2363

Closed
Wondertan opened this issue Jun 13, 2023 · 4 comments
Closed

gateway: set CORS headers for browser support #2363

Wondertan opened this issue Jun 13, 2023 · 4 comments
Assignees

Comments

@Wondertan
Copy link
Member

Wondertan commented Jun 13, 2023

@smuu was recently hacking on celestia-node and wasn't able to use any of our APIs in the browser because of CORS issues. We should add CORS headers on both gateway and RPC and allow all the origins

@Wondertan Wondertan changed the title gateway+rpc: set CORS headers for browser support gateway: set CORS headers for browser support Jun 13, 2023
@Wondertan
Copy link
Member Author

Wondertan commented Jun 13, 2023

Ok, RPC is set, we should still test it manually though

@distractedm1nd
Copy link
Collaborator

If the RPC is setting * that is actually a security vulnerability. The correct way to do this is to add a list of allowed origins to the config. Developers can add * there if they want

@Wondertan
Copy link
Member Author

Wondertan commented Jun 13, 2023

Ideally, the port the RPC server listens on should not be exposed to WAN. It can be shared in LAN or within datacenter clusters. Even if there is a rare usecase for remote usage, it's better to filter on the IP firewall level rather than polluting the config with HTTP headers for the gateway.

@renaynay
Copy link
Member

#2373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants