Replies: 4 comments 10 replies
-
|
Currently, you can still use csurf even though it is in deprecated mode. If the package accomplishes the job you need it to, use it. Im catching up here to see if there is any signal in the noise of snyk reports. But I think you miss an important part of the issue at hand OP, which is that the snyk reports' quality is considered very low and noisey. What I mean is, looking st snyk reports in vscode and implementing their suggestions blindly is the opposite of what work (if any) needs to be done here. Edit: I see your screenshots are not from csurf itself, but from application code and snyk is recommending using csurf to fix issues in your app. You can still take those recommendations, but you should evaluate if the vuln they are suggesting your app has is actually valid for your use cases. |
Beta Was this translation helpful? Give feedback.
-
|
I suggest you switch to https://github.com/birdofpreyru/csurf (https://www.npmjs.com/package/@dr.pogodin/csurf) — my fork of the original ExpressJS csurf, that keeps the original API and logic, and takes care about keeping all dependencies up-to-date, and other necessary maintenance. Or, as I put it into its README:
|
Beta Was this translation helpful? Give feedback.
-
|
Since the link from the Timeline
Situation for now We have 2 alternatives
There are a couple more packages, but I don't list them here because of their lower popularity |
Beta Was this translation helpful? Give feedback.
-
|
Over in Go land, version 1.25 introduced a new middleware,
As per this blog post by Alex Edwards, if you also enforce HTTPS connections and TLS v1.3 or later, then you exclude most older browsers that don't send these headers (pre-2018–2019). If your risk profile allows it, you might prefer allowing TLS v1.2, and relying on the lesser protections offered by Is there any interest in copying the header inspection approach in an Express.js middleware? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
csurf is still one if if not the most downloaded and widely used CSRF protection middleware on NPM source with over 330,000 weekly downloads...
Yet express.js/csurf has not been updated in the last 4 years+. The reason being a "large influx of security vulunerability reports received". From what I can tell Snyk comes up a lot
... However checking the pages referred to in discussions I see "Amendment This was deemed not a vulnerability." and 404s for the posts talking about "vulnerabilities in csrf", such as this one.
It's sad to see such a widely used package shut down because of such issues... and what it seems accusations that later were amended. I may be missing something massive, however.
With the rise of AI, such as Github Copilot I see a lot of suggestions for csurf.
Heck, I have the Snyk extension installed in VSCode, and the "⚠️ Medium Severity | Cross-Site Request Forgery (CSRF) | Priority Score 570 | Vulnerability: CWE-352". The extension gives me some examples of "solutions"... Here are some excerpts:



Every "solution" includes csurf. A 4-year depreciated package.
I'm overwhelmed with my own projects, job and more so I can understand how being beat down relentlessly destroys such an open-source package, and I can sympathise with the developers...
But: What package are people using now? What is going to replace csurf?
I am very out of the loop with all of this.
Beta Was this translation helpful? Give feedback.
All reactions