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

HTTP: Add CORS Header for private network access #3363

Merged
merged 3 commits into from
Jan 6, 2023

Conversation

toss156
Copy link
Contributor

@toss156 toss156 commented Jan 6, 2023

Chrome will start sending a CORS preflight request ahead of any private network request for a subresource, which asks for explicit permission from the target server. This preflight request will carry a new header, Access-Control-Request-Private-Network: true, and the response to it must carry a corresponding header, Access-Control-Allow-Private-Network: true.

The aim is to protect users from cross-site request forgery (CSRF) attacks targeting routers and other devices on private networks. These attacks have affected hundreds of thousands of users, allowing attackers to redirect them to malicious servers.

Reference content:
Make sure to maintain the markdown structure.
https://developer.chrome.com/blog/private-network-access-preflight/
#2787 RTC: Ensure private network requests are made from secure contexts


TRANS_BY_GPT3

@winlinvip winlinvip merged commit eeb42f7 into ossrs:develop Jan 6, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
@kirakiseki
Copy link

Hi! I'm currently facing the same CORS problem, after searching for documents, I think the header added in this PR should be set to "Access-Control-Allow-Private-Network" instead of "Access-Control-Request-Private-Network" which is used in preflight requests.

You can also refer to the same documents as those in the description of this PR.

If there are still any other problems, plz feel free to reach me out! Thanks:)

Copy link

@darik07 darik07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants