DEV Community

NodeJS Security Best Practices

Mohammad Faisal on February 19, 2024

To read more articles like this, visit my blog Today, we will see how we can improve the security of a NodeJS application. There are lots of aspec...
Collapse
 
lirantal profile image
Liran Tal

I want to say congrats on helping spread awareness to application security in Node.js but honestly many of the takes here are not well communicated and will only result in frustration or worst, a security vulnerability.

One example, is the That's it! You don't need to do anything else! statement after the first suggestion to use helmet. Helmet is a useful package but it's not going to prevent by itself XSS or Clickjacking.

Similarly, you continue to write about preventing denial of service, but the toobusy package isn't by design adding any preventative measures and doesn't protect your Node.js server from suffering a denial of service attack.

Collapse
 
walterpierson profile image
walterpierson

great effort

Collapse
 
kiliaosi profile image
wangzhi

great

Collapse
 
sahillangoo profile image
Sahil Langoo

Noice!

Collapse
 
whitersun profile image
whitersun

from cors where is the corsOptions place to put in?

Collapse
 
bmonish profile image
Monish B

app.use(cors(corsOptions))

Refer Here: npmjs.com/package/cors#configuring...

Collapse
 
msrajawat298 profile image
Mayank Singh Kushwah

good to know there is lots of pre built packages that helps lots of.

Collapse
 
mrizwanashiq profile image
Muhammad Rizwan Ashiq

I love this "Nothing is bulletproof, but being safe doesn't hurt."