Javascript is susceptible to all sorts of vulnerabilities, allowing bad actors to insert malicious code into Node applications and packages. Defensive programming combats these vulnerabilities, ensuring software continues to function in unanticipated circumstances. In this lesson, we will dive into common Node.js code vulnerabilities, their risks, and defensive coding techniques.

We’ll cover:

  • Risky functions and methods like eval() and exec()
  • The dangers of using the fs module
  • Regular expression vulnerabilities
  • Tips to secure your code


Go to the next exercise when you’re ready to begin!

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?