-
Notifications
You must be signed in to change notification settings - Fork 15
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
Cross-site Request Forgery (CSRF) found in csurf package #153
Comments
Hi @IdanAdar sorry about that. The tracker was flooded and I had to limit it while I got some time to add a message. You'll need to choose another module, unfortunately. |
@dougwilson, is this the official decision of the ExpressJS org which houses this package? |
Hi @IdanAdar yes, it is. Do you have any suggestions for fixing the underlying issue? The module gets almost a monthly report about the fact that you can do exactly what the OAWASP csrf articles says is possible. If you would like to take over the module, the license allows that and we can direct everyone to the version you have 👍 |
What alternative module are you suggesting the world to use, please? |
One which is not "vulnerable". I have not evaluated others at this time so am not looking to make a specific suggestion and opening myself to liability. If you have a suggestion that would be awesome and I can list it 👍 You may also try contacting that security researcher and see if they have a suggested module; you're also welcome to fork the module and fix it such that it is secure and I'd be happy to point to your module. I'm not sure what else you're looking for. Any help regarding that answer is appreciated, as I don't have an answer for ya. Edit: you can also try reaching out to Snyk for a suggestion, as they are the ones who first blacklisted the module, and so I am just putting notice up on the repo and stuff now that it's deprecated, as that is the word from Snyk. |
FWIW I just sent Snyk a request for what specific code changes would solve the issue at hand and remove the blacklist. |
Hi @IdanAdar I just wanted to follow up here since you gave the above a thumbs up that I have just got a response back that the request is being escalated, but nothing further as of yet. |
The only response I have gotten was simply to point to their own Synk page and it took a bit to even have them realize they were talking to the package maintainer, and then still no code guidance. I'm going to close this as it does not seem like they are willing to help and I don't have the energy to fight them about it. |
And to help make it clear the frustration here: it states that the package does not value the After the Snyk blacklist of the package, I have archived and deprecated out of frustration as it will just be endless issues opened in the package from users who don't know what to do, and I have no PoC to work against to solve anything. The security side of these reports is very one sided and places like Snyk wield large power to effectively blacklist a module and never even contact the author about anything. Then when one tries to contact them, you just get some low level support who doesn't understand the technical details and no help. And since Snyk lists the version range as |
I will add that I still have not been able to reach beyond the front line support in Snyk which has not been helpful in any way, just proving the link above. Also if this package were really that popular, one would think that lots of folks would be reaching out/offering to help/anything. This is the only one in over a week so far, so either it's just not very popular or no one actually cares to help, which is a demonstration for why it was simply deprecated after Snyk blacklisted the module. |
I’m trying some internal contacts to get proper response from Snyk. I agree it’s irresponsible from them. |
Thanks, it is appreciated. For more context (sorry this all came down fast and is just very upsetting -- especially Snyk blacklisting the module without even reaching out before hand), the security article they reference I did have correspondence with, but I asked over and over again for a PoC to demonstrate the issue and they refused, saying it was the client's code. I gave them the example from the README and I asked for them to alter it (as necessary) and provide the steps to reproduce the issue and they told me they were just a product manager and didn't know how to run the Node.js code. I helped get it running, but still no instructions. I then made multiple changes and provided the person them asking if they addressed the issues or not, but no. I was left just I guess trying to guess what I was supposed to do and after that going on for 2 months, I threw up my hands and said if he thinks it's vulnerable, then I guess it is and left it as that, as I have no idea what exactly I'm supposed to be changing to fix whatever. I'm not CSRF expect and didn't even write the module. I took it over as that author left the project, but I don't have time to play 1 million questions with some security researchers who won't even provide a PoC or a patch. Once Snyk blacklisted it, my experience interactive with Snyk tells me just to abandon the module at that point. I didn't even deprecate it until you filed this issue bringing up that Snyk blacklisted it. |
Thank you, I already saw that. It unfortunately doesn't provide any PoC that demos the issue(s) and ultimately if someone else can decipher the fixes from that, they are 100% welcome to fork the package, make the fixes, and I can update the readme to point there. Also if that was there to explain it, why did they not send that to me before blacklisting it? They have still never reached out, and I never deprecated the module until after they blacklisted it. I'm over Snyk at this point. I still have not gotten their support to help. Theyclearly do not care about fixing anything and just want to write blogs. I mean, they end with "just use this ither framework instead of Express". |
@dougwilson Hi there! I'm from the Security Operations Room at Snyk, who published the advisory after we'd been alerted to the vulnerability from this blog post. We understood the description there, including the timeline indicating responsible disclosure with maintainer participation, to mean that the exploit vector described was duly confirmed and public knowledge. I apologize for our not communicating with you for direct confirmation, which is our standard practice when we are the discoverers or initial reporters of a vulnerability. Having been pointed to the current thread by a user, we'd be happy to discuss the issue itself, clarify its scope, exploitability, and affected versions, and share an in-house PoC (currently being built) with you - here or via [email protected]. We by no means intended to blacklist the package and very much appreciate the work put in by voluntary maintainers like yourself to keep open source going! |
Hi @jntnmoses thank you for that. I have emailed there and been in contact with an agent for many weeks now and got no where. How will emailing again actually get the response you are mentioning? Is there a different email I can use to get to someone more direct? I don't have further time or care at this point to do anything further. It has been a month now, and the damage is done. I am no longer interested in futher discussion on this. |
@dougwilson [email protected] is a direct link to the security division at Snyk - I think that you might have run into some technical issues interfacing with [email protected] which is our support team. But as @jntnmoses mentioned above we're very happy to discuss the issue further either here or in a direct and private comms - in general this would be the way we'd like to communicate with maintainers on a vulnerability disclosure, and it appears we were misled by what seemed to be a responsible disclosure of this vulnerability prior to our publication. Sorry that you have been frustrated up till now but if you were interested in discussing further and either limiting the existing impact of this vulnerability, or discussing ways to fix it - we would be more than happy to help out rather then you needing to abandon this project which we know provides value to the open source community 🙏 |
@dougwilson Can we take another swing at this in the spirit of collaboration? |
To update - we have updated our advisory based on the feedback provided by @dougwilson so far to change the severity of this vulnerability from medium to low reflecting the numerous conditions required to exploit the vulnerability, limited it's impact to version 1.2.0 and greater, and added context to explain the necessary pre-conditions required to exploit. We're happy to suggest from experience various ways to solve the issue, but I would also think it a reasonable stance to document a low-severity issue as a non-fix, and continue development of the library with that documentation noting users of the theoretical low risk involved in using it. |
No no no no no, I'm not happy with that! You didn't provide a single proof in which If you fail to provide that evidence, I expect the deletion of that article and apologies. NB: for a moment an idea flashed through my mind is that you could think that some bank would allow transactions on a |
I think there is some confusion here.
We are not the authors of the original article, we saw the article after it
had already been published and seemingly acknowledge and responsibly
disclosed - and published a corresponding advisory based on that. I think
your criticism here would be better placed with the authors and vendors
behind that article, rather then with us.
My team and I were first made aware of the issues behind this article a
week or so ago after we were made aware of this thread, from which point
we've been trying to take on board the feedback @dougwilson has been providing and
attempting to adapt to it.
We're happy to continue to engage and adapt as well - but please try and trust that there are people acting in good faith here, and engage with us accordingly - I promise that we will be very happy to revoke the advisory in it's entirety if that's indeed the best case.
Note: edited after confusion on my part 😅
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I'm just an
As a |
Your advice lead to deprecation of this library. I am amazed by the fact that you made this decision based on an article without trying to produce a valid proof based strictly on the existing documentation. If you had done the same to a commercial company you probably would have lost many dollars in court. Looking forward for your good faith (and I hope that you are aware that now 150k+ projects and probably millions of installations receive in the console this deprecation status, which since we talk about security can only mean one thing: PANIC!) |
My previous comments were started having in mind an article written by
The
A quick recap:
If we agree about the above points now we can start another analysis to see if a correct implementation with apropriate expectations can be found "vulnerable". Now let's disect the Basically, what they say is that knowing the token generarion mechanism combined with
Conclusions from the Missleading picture from the So, what I expect from
|
Thank you @SorinGFS for your through post above. I'll add to that that (a) I asked fortbridge over and over again to provide a PoC and one was never provide -- they actually ask me to provide a PoC, like, what? (b) they asserted over and over again that this magic xsrf-token cookie was not validated -- but i tried to explain that the double-submit is one piece of data in a cookie (the as you have noted that at best it relies on xss (which breaks csrf protections as noted in owasp) or cookie tossing (which just set the cookie to i deprecated it because of these social reasons, not because i believe there is any true vulnerabilities in it. csurf being so popular attracts people just looking to get their name out there on vulnerability discoveries and as it seems you are aware csrf in particular is very nuanced and reports i receive have all been unclear without any evidence in showing an attach working (like this one) or have been a form of xss or similar. getting 1-2 reports like this every single month for the past 14 months now is just exhausting and i would say 90% of them start off with a closed mind and are not interested in hearing me say what they report is not a vulnerability. and there is a lot of external social pressure when before i even know, multiple blogs are out on security sites about an issue (like this one) and users flood in and are not very interested in hearing me explain there is no vulnerability, as the security scanners and sites say there is -- how i am a more reliable source, as i probably have an interest in saying nothing is wrong /shrug anyway, there you go, i have laid out a lot there and folks can take it as they like. it is unclear why the snyk blog post has been removed but i guess that is progress ? ultimately bringing the module back to life now is only going to result in more questions by all these folks who read about how it is broken. if it were to be reinstated, it would ideally need to have some kind of link to snyk about it so folks would know what to do now, which i think is also what you suggested @SorinGFS |
I can imagine the pressure, but I really think you should ignore any report that doesn't come with a proof that respects the procedure I mentioned above. Even those in the present case, if they had followed these procedures, they would not have put themselves in the ridiculous situation of admitting that they were wrong. And the cases of real vulnerabilities, if there were such things, I think we would be happy to know and fix them. But luckily they don't exist. When I decided to use this library I studied tons of materials, lots of libraries and I made every test possible to ensure that I made a good choice for my project. Here is how I implemented the csrf protection. Cyber security is not child's play, that's why it's hard for me to understand how these companies hired people without the right qualifications. The only explanation can be that the motivation behind it is different than finding real vulnerabilities. |
I'm not sure what that really means, but I'm not sure it's worth the effort. The Snyk advisory I see still stands and ultimately I deprecated the module due to it being noted as vulnerable. Again, that decision is not due to only that, simply the final cause. I took over maintaining the module after an absence of the original author, but I am not an expert in CSRF, and a module like that probably needs to be run by such an expert. I have mostly left the module working exactlt as I received it as I don't want to make unnecessary changes since I don't know all the particulars of the subject matter of CSRF. Really, I think ultimately the best thing for everyone is if someone very knowledgeable in CSRF wants to do the goodwill of publishing an Express.js CSRF middleware module to npm. |
What this really means is this: that
Is not that easy you know, to replace a basic library like this one in hundreds of thousands of projects and millions of installations.... It wouldn't be easy even if the later library would contain exact same code and just to replace the reference to it... It would take years until every single dependent project would be able to replace it. And all of this for what? For the lack of knowledge or good faith of a bunch of guys calling themselves "security advisors"? Come on! If it were that easy, I would be the first to help you, it would be an honor for me. But it's not easy! You have a reputation to defend! What will you do if in the future these attacks would also appear at Express? Will you also give up Express too? I know that you know the guys from Koa team. What they say about this matter? |
@dougwilson We've decided on the basis of our research that this isn't exploitable without having achieved an additional exploit, nor on domains that have no subdomains that can be leveraged, nor on implementations using stateful session middleware such as We very much appreciate your open source work and that of the other maintainers in the open source world, and apologize for the trouble this caused for you personally. We would be happy to work with you or other developers on the implementation of the hardening suggestions below, via [email protected]. Recommendations:
|
@jntnmoses @dougwilson |
The 7th row of documentation is like this:
I remembered that more than 2 years ago I wrote this issue on
I will not comment on the obvious logical fractures in that document but this conclusion. First of all, Therefore, I think you should replace the link to this missleading
I can try a PR if you don't have time. |
Thanks all! @dougwilson are you willing now to undo the deprecation, pretty please? |
Wow. What an informative, frustrating and sad issue to read through. The spirit of OSS crushed by corporate America. |
Do we have alternative packages to csurf? it seems unmaintained, and recently a vulnerability was discovered.
https://snyk.io/vuln/SNYK-JS-CSURF-3021144
Given the popularity of this package, the impact radius is large...
The text was updated successfully, but these errors were encountered: