ejj | My personal site , completely run on Cloudflare | Portfolio library
kandi X-RAY | ejj Summary
kandi X-RAY | ejj Summary
My personal site. Read this.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ejj
ejj Key Features
ejj Examples and Code Snippets
Community Discussions
Trending Discussions on ejj
QUESTION
I'm working on an authorization API that my company would like to use both internally and as an external API for some of our customers. We'd prefer to not have to whitelist every domain from which a request might originate, but that seems to be the default behavior web browsers are designed to enforce when the withCredentials
option of an XHR is true
.
We can work around this problem by having our API return whatever the Origin
header of a request contains as the value of the Access-Control-Allow-Origin
header of the API's response, but that apparently is what's supposedly so dangerous, so I'm not sure we should be doing this. Maybe in our situation it's perfectly safe, but not understanding the nature of the potential attack, I can't yet say.
According to this article:
https://portswigger.net/research/exploiting-cors-misconfigurations-for-bitcoins-and-bounties
...this kind of CORS behavior was exploitable enough that the author could easily have stolen other people's bitcoins from a bitcoin exchange.
But how? For me, the article doesn't make that clear.
Is there some other vulnerability beyond the CORS issue that is needed? Looking at the examples, the PDF of a slide presentation that goes with the article, and a referenced article at http://ejj.io/misconfigured-cors/, I'm not fully understanding where access to some other user's info or credentials slips into the picture.
In the diagram above, it looks to me like "evil.com" would somehow have to be tricking a user into giving evil.com their bitcoin exchange credentials first, before CORS enters the picture, and if evil.com can do that already, wouldn't the CORS issue only make an already very bad situation just a little worse?
I'm sure that it can't be that simple, or no one would be raising the alarm about a fully open origin policy, but I can't figure out what I'm missing here.
Is there something where, say, just having one browser page opened to evil.com, while a user is also visiting their bitcoin exchange, allows cookie data to be passed over to evil.com? Seems like that would also be a big problem too, CORS or no CORS.
...ANSWER
Answered 2019-Nov-05 at 18:11I finally figured out where the risk is, and I had to figure it out for myself. Maybe all the people explaining this CORS exploit think that their readers will automatically know what's going on with cookies in a situation like this, and don't think it's even worth mentioning.
It certainly would have helped me if they'd mentioned it, however!
What I understand now is this:
- You set up an API on myservice.com that allows CORS access, it lets anyone from any domain in, and it responds to XHR requests where
withCredentials
istrue
with the host's origin reflected back in theAccess-Control-Accept-Origin
header, rather than sending back*
. - A user on mylegitapicustomer.com, which legitimately uses myservice.com, logs into your API, and gets back a session cookie that belongs to the myservice.com domain.
- That user, using the same web browser, then visits evilhacker.com.
- If the webpage from evilhacker.com issues an XHR request to myservice.com, all of the cookies that belong to the myservice.com domain go along for the ride!
- Your website at myservice.com sees the session cookie it issued to the legit user who had visited via mylegitapicustomer.com and happily responds to the above request by making any requested changes to the user's account, or responds with any info about the user requested.
- evilhacker.com can now receive any of this info, and/or perform any API actions, that legit access via mylegitapicustomer.com would have allowed.
QUESTION
to pay
charges
from one's
bank account
...ANSWER
Answered 2018-Apr-20 at 21:39Edit:
After digging into the dictionary website a bit, I came up with the following solution. Under a each
tag of a sentence, we could do the following:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ejj
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page