Anh ơi, CORS giúp ứng dụng chặn các request lạ, chỉ cho phép gọi API từ những nguồn mình cho phép. Liệu sử dụng CORS có thật sự hữu ích k ạ, em tính bỏ CORS vì mỗi lần accept lại phải add nguồn mới
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Chắc chắn là hữu ích rồi em, nếu em để API có thể gọi từ bất kể domain nào, rất có thể sẽ có người giả mạo trang và từ đó có thể đánh cắp được mật khẩu, token hay các thông tin nhạy cảm khác của người dùng và thế là toang.
Ví dụ facebook.com để cors là *, vậy ta có thể tạo ra trang fakebook.com và lừa người dùng đăng nhập, nếu người dùng đăng nhập thành công thì ta biết được mật khẩu người dùng là đúng và đồng thời ta cũng nhận được token từ facebook trả về, vậy thì ta có thể làm mọi thứ trên tài khoản của người dùng rồi.