Skip to main content
deleted 13 characters in body; edited title
Source Link
SilverlightFox
  • 33.8k
  • 12
  • 85
  • 154

Understanding AJAX CORS and security considirationsconsiderations

I tryam trying to understand why CORS is working in way that it works.

As I learned from this post[this post][1], when page from www.a.comwww.a.com makes AJAX request to www.b.comwww.b.com, then it's the www.b.comwww.b.com that decides if request should be allowed or not.

But what is exactly secured on client in such model? For example, if a hacker successsucceeds to make an XSS script injection to my page, then it makes an AJAX request to his domain to store user data. So hackersa hacker's domain will allow such a request for sure.

What I thought, that it's a www.a.com should decide to which domains to allow the request and to which no. So in theory within a header Access-Control-Allow-Origin I would like to put the whole list of the domains that are allowed for AJAX CORS requests.

Can someone explain what security problems shouldthe current CORS implementation handlehandles?

Thanks [1]: http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/

Understanding AJAX CORS and security considirations

I try to understand why CORS is working in way that it works.

As I learned from this post, when page from www.a.com makes AJAX request to www.b.com, then it's the www.b.com that decides if request should be allowed or not.

But what is exactly secured on client in such model? For example, hacker success to make XSS script injection to my page, then it makes AJAX request to his domain to store user data. So hackers domain will allow such request for sure.

What I thought, that it's a www.a.com should decide to which domains to allow the request and to which no. So in theory within a header Access-Control-Allow-Origin I would like to put the whole list of the domains that allowed for AJAX CORS requests.

Can someone explain what security problems should current CORS implementation handle?

Thanks

Understanding AJAX CORS and security considerations

I am trying to understand why CORS is working in way that it works.

As I learned from [this post][1], when page from www.a.com makes AJAX request to www.b.com, then it's the www.b.com that decides if request should be allowed or not.

But what is exactly secured on client in such model? For example, if a hacker succeeds to make an XSS script injection to my page, then it makes an AJAX request to his domain to store user data. So a hacker's domain will allow such a request for sure.

I thought that www.a.com should decide to which domains to allow the request to. So in theory within a header Access-Control-Allow-Origin I would like to put the whole list of the domains that are allowed for AJAX CORS requests.

Can someone explain what security problems the current CORS implementation handles? [1]: http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/

Source Link
Alex Dn
  • 5.6k
  • 11
  • 45
  • 85

Understanding AJAX CORS and security considirations

I try to understand why CORS is working in way that it works.

As I learned from this post, when page from www.a.com makes AJAX request to www.b.com, then it's the www.b.com that decides if request should be allowed or not.

But what is exactly secured on client in such model? For example, hacker success to make XSS script injection to my page, then it makes AJAX request to his domain to store user data. So hackers domain will allow such request for sure.

What I thought, that it's a www.a.com should decide to which domains to allow the request and to which no. So in theory within a header Access-Control-Allow-Origin I would like to put the whole list of the domains that allowed for AJAX CORS requests.

Can someone explain what security problems should current CORS implementation handle?

Thanks