What is a Vulnerability and What’s Not? Making Sense of Node.js and Express Threat Models

This ad is not shown to multipass and full ticket holders
React Summit
React Summit 2025
June 13 - 17, 2025
Amsterdam & Online
The biggest React conference worldwide
Learn More
In partnership with Focus Reactive
Upcoming event
React Summit 2025
React Summit 2025
June 13 - 17, 2025. Amsterdam & Online
Learn more
Bookmark
Slides
Rate this content

Security isn’t just about fixing bugs; it’s about understanding the assumptions we make (and avoiding unnecessary panic). In this talk, we’ll dive into the Node.js and Express threat models, which I co-authored, to break down what they trust, what they don’t, and why that actually matters for developers and security researchers.

We’ll take a look at real-world vulnerabilities that fit within these models, clear up some of the most common security misconceptions (because not everything is a critical meltdown), and explore how these security assumptions influence bug bounties, exploitability, and long-term fixes. By the end, attendees will walk away with a much better sense of what’s a real security risk, what isn’t, and how to build applications that won’t keep them up at night.

This talk has been presented at Node Congress 2025, check out the latest edition of this JavaScript Conference.

FAQ

A vulnerability is a flaw, security misconfiguration, or weak point in a system that can be exploited by third parties to behave in unintended ways.

A threat model is a structured approach to identify security risks, possible mitigations, attackers, and actors, and to understand what can go wrong in a system.

Developers are responsible for validating and sanitizing input, managing dependencies, handling errors properly, and implementing security measures such as security headers and monitoring.

The shared responsibility model outlines the division of security responsibilities between cloud service providers and users, where providers manage infrastructure security, and users handle data and application security.

Best practices include input validation, understanding authentication, using security headers, regularly auditing dependencies, and implementing resource limits and proper error handling.

Threat models help developers understand potential security threats, define boundaries of trust, and guide the implementation of security measures in their projects.

Tools like Snyk and Socket can help manage security by auditing dependencies and identifying vulnerabilities in Node.js applications.

Prototype pollution is a vulnerability in JavaScript where an attacker can manipulate the prototype of an object, potentially leading to unexpected behavior and security risks.

Ulisses Gascon is a software engineer at NodeSource and a core team member of Yeoman, Node.js, and Express, focusing on security in the ecosystem.

Common vulnerabilities include SQL injections and misconfigurations in libraries like Express, which can lead to denial of service or other security issues.

Ulises Gascón
Ulises Gascón
17 min
17 Apr, 2025

Comments

Sign in or register to post your comment.
  • Costanza
    Costanza
    Bromley web works. Founder
    👍
Video Summary and Transcription
In this talk, we will discuss security, vulnerabilities, and how to improve your overall security. We will explore various vulnerabilities and the difference between developer errors and misconfigurations. Understanding threat models is crucial in determining responsibility for vulnerabilities. Developers have the ultimate responsibility for handling user input, network data, and other factors. Understanding threat models, best practices, and taking ownership of dependencies are key to improving security. Security is an ongoing process that requires dedication and understanding.

1. Introduction to Security and Vulnerabilities

Short description:

In this talk, we will discuss security, vulnerabilities, and how to improve your overall security. A vulnerability is a flaw, security misconfiguration, or weak point in our system that can be exploited by third parties. Today, we will explore various vulnerabilities.

Hola, I'm Ulisses Gascon, and in this talk we are going to discuss a lot about security. We are going to go deeply about understanding what is a vulnerability and what is not, while you are using your most loved tools like Node.js or Express, right?

So basically who I am. I am a software engineer at NodeSource. I'm also part of the core team of Yeoman, Node.js, and Express, and I'm trying to help in the ecosystem a lot about security. I'm participating in a lot of collab spaces and working groups and so on. And the idea today is discussing about what is a vulnerability and not, and how you can improve your own security overall.

So basically, what is a vulnerability? In very simple terms, and if we use the Wikipedia, we will understand that a vulnerability is basically a flaw, a security misconfiguration or a weak point in our system. So basically, they are flaws. The thing is, these flaws can be used by third parties to exploit our systems, right? And make them work in ways that we don't anticipate. That's what we consider a security problem. And basically today we are going to discover a lot of these flaws.

2. Understanding Vulnerabilities and Threat Models

Short description:

In the examples given, one is a clear case of developer error with a SQL injection, while the other is a misconfiguration that exposes a vulnerability. Understanding the difference between these two scenarios is crucial in determining the responsibility for vulnerabilities. The talk will focus on threat models, a structured approach to understanding security risks, identifying potential threats, and discussing mitigations. It explores what needs to be protected, potential issues, and boundaries, and provides recommendations for improving security.

The first thing is like, when we face any kind of security challenge, for example, here we have two examples that are actually weak code, let's say. So in the first example, we see clearly that there is a SQL injection here, right? We are not doing any kind of validation on this data.name, right, basically. So that's something that can be bad. And in the second example, we don't see nothing especially weird aside of this huge limit that we say in one of the arguments when we did the configuration for the body parser. But yeah, basically we are using Express, nothing super weird and body parser, right? So in the first example, it's very clear for us that maybe who we can blame, basically might be the developer.

And in the second case, it's not very clear, right? Because depending on how you are managing this, you have two perspectives here. So one is like, if you have a SQL injection, that is how you are using the tool and you are using the tool wrongly. So in this case, for example, is blaming the developer, right, to make the mistake to include the SQL injection. But in the other case, it's not that simple. It's mostly our vulnerability, right? So we define how the framework should work, how the libraries should work in this case. And there is a misconfiguration from the decision that we made in the project that make this weak point possible to be exploited, right? So we got a CVE the last year and we can see clearly that this can end up on a denial of service because there are some options to make, you know, crafted payloads that might, you know, float over server. So this is the kind of scenarios that we deal. We are going to discuss a lot today on what are the two main difference between these kind of things and how we can understand and expect what is considered a vulnerability in the eyes of the developer and what is considered a vulnerability in the eyes of the maintainers of the libraries or the runtime that you love to use, right?

So basically, the most important thing today, the introduction of this talk is going to be about the threat models. So basically, what is a threat model? So for us, a threat model is a simple document. I mean, the final output is a document, but mostly it's a structured approach to understand the security risk, possible mitigations, we try to identify the attackers and the actors and what can go wrong. So basically, it's an exercise that we do as part of the project and we try to respond to some of these questions, right? Like what we are trying to protect, you know, what can go wrong? What are the issues that we might see around this? What are the potential threats that we are seeing here? It is something that can be caused by a misunderstanding, can be a bot, can be, you know, attackers, can be whatever, right? What are the boundaries? That is a very important question that we should ask when we build a library, when we build a runtime, right? Like what are the things that we consider trustfully or not trustfully so we can understand that. And also we discuss a lot about the mitigations, right? What, what we need to do, I mean, how are the scenarios and what the users of our own environments can do to improve the security, right? And we build the recommendations and so on so that people get a better understanding on how this works.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

It's a Jungle Out There: What's Really Going on Inside Your Node_Modules Folder
Node Congress 2022Node Congress 2022
26 min
It's a Jungle Out There: What's Really Going on Inside Your Node_Modules Folder
Top Content
The talk discusses the importance of supply chain security in the open source ecosystem, highlighting the risks of relying on open source code without proper code review. It explores the trend of supply chain attacks and the need for a new approach to detect and block malicious dependencies. The talk also introduces Socket, a tool that assesses the security of packages and provides automation and analysis to protect against malware and supply chain attacks. It emphasizes the need to prioritize security in software development and offers insights into potential solutions such as realms and Deno's command line flags.
The State of Passwordless Auth on the Web
JSNation 2023JSNation 2023
30 min
The State of Passwordless Auth on the Web
Passwords are terrible and easily hacked, with most people not using password managers. The credential management API and autocomplete attribute can improve user experience and security. Two-factor authentication enhances security but regresses user experience. Passkeys offer a seamless and secure login experience, but browser support may be limited. Recommendations include detecting Passkey support and offering fallbacks to passwords and two-factor authentication.
5 Ways You Could Have Hacked Node.js
JSNation 2023JSNation 2023
22 min
5 Ways You Could Have Hacked Node.js
Top Content
The Node.js security team is responsible for addressing vulnerabilities and receives reports through HackerOne. The Talk discusses various hacking techniques, including DLL injections and DNS rebinding attacks. It also highlights Node.js security vulnerabilities such as HTTP request smuggling and certification validation. The importance of using HTTP proxy tunneling and the experimental permission model in Node.js 20 is emphasized. NearForm, a company specializing in Node.js, offers services for scaling and improving security.
Content Security Policy with Next.js: Leveling Up your Website's Security
React Summit US 2023React Summit US 2023
9 min
Content Security Policy with Next.js: Leveling Up your Website's Security
Top Content
Watch video: Content Security Policy with Next.js: Leveling Up your Website's Security
Lucas Estevão, a Principal UI Engineer and Technical Manager at Avenue Code, discusses how to implement Content Security Policy (CSP) with Next.js to enhance website security. He explains that CSP is a security layer that protects against cross-site scripting and data injection attacks by restricting browser functionality. The talk covers adding CSP to an XJS application using meta tags or headers, and demonstrates the use of the 'nonce' attribute for allowing inline scripts securely. Estevão also highlights the importance of using content security reports to identify and improve application security.
How React Applications Get Hacked in the Real-World
React Summit 2022React Summit 2022
7 min
How React Applications Get Hacked in the Real-World
Top Content
How to hack a RealWorld live React application in seven minutes. Tips, best practices, and pitfalls when writing React code. XSS and cross-site scripting in React. React's secure by default, but not always. The first thing to discover: adding a link to a React application. React code vulnerability: cross-site scripting with Twitter link. React doesn't sanitize or output H ref attributes. Fix attempts: detect JavaScript, use dummy hashtag, transition to lowercase. Control corrector exploit. Best practices: avoid denialist approach, sanitize user inputs. React's lack of sanitization and output encoding for user inputs. Exploring XSS vulnerabilities and the need to pretty print JSON. The React JSON pretty package and its potential XSS risks. The importance of context encoding and secure coding practices.
Let Me Show You How React Applications Get Hacked in the Real-World
React Advanced 2021React Advanced 2021
22 min
Let Me Show You How React Applications Get Hacked in the Real-World
Top Content
React's default security against XSS vulnerabilities, exploring and fixing XSS vulnerabilities in React, exploring control characters and security issues, exploring an alternative solution for JSON parsing, and exploring JSON input and third-party dependencies.

Workshops on related topic

Hands-On Workshop: Introduction to Pentesting for Web Apps / Web APIs
JSNation US 2024JSNation US 2024
148 min
Hands-On Workshop: Introduction to Pentesting for Web Apps / Web APIs
Featured Workshop
Gregor Biswanger
Gregor Biswanger
In this hands-on workshop, you will be equipped with the tools to effectively test the security of web applications. This course is designed for beginners as well as those already familiar with web application security testing who wish to expand their knowledge. In a world where websites play an increasingly central role, ensuring the security of these technologies is crucial. Understanding the attacker's perspective and knowing the appropriate defense mechanisms have become essential skills for IT professionals.This workshop, led by the renowned trainer Gregor Biswanger, will guide you through the use of industry-standard pentesting tools such as Burp Suite, OWASP ZAP, and the professional pentesting framework Metasploit. You will learn how to identify and exploit common vulnerabilities in web applications. Through practical exercises and challenges, you will be able to put your theoretical knowledge into practice and expand it. In this course, you will acquire the fundamental skills necessary to protect your websites from attacks and enhance the security of your systems.
0 to Auth in an hour with ReactJS
React Summit 2023React Summit 2023
56 min
0 to Auth in an hour with ReactJS
WorkshopFree
Kevin Gao
Kevin Gao
Passwordless authentication may seem complex, but it is simple to add it to any app using the right tool. There are multiple alternatives that are much better than passwords to identify and authenticate your users - including SSO, SAML, OAuth, Magic Links, One-Time Passwords, and Authenticator Apps.
While addressing security aspects and avoiding common pitfalls, we will enhance a full-stack JS application (Node.js backend + React frontend) to authenticate users with OAuth (social login) and One Time Passwords (email), including:- User authentication - Managing user interactions, returning session / refresh JWTs- Session management and validation - Storing the session securely for subsequent client requests, validating / refreshing sessions- Basic Authorization - extracting and validating claims from the session token JWT and handling authorization in backend flows
At the end of the workshop, we will also touch other approaches of authentication implementation with Descope - using frontend or backend SDKs.
OWASP Top Ten Security Vulnerabilities in Node.js
JSNation 2024JSNation 2024
97 min
OWASP Top Ten Security Vulnerabilities in Node.js
Workshop
Marco Ippolito
Marco Ippolito
In this workshop, we'll cover the top 10 most common vulnerabilities and critical security risks identified by OWASP, which is a trusted authority in Web Application Security.During the workshop, you will learn how to prevent these vulnerabilities and develop the ability to recognize them in web applications.The workshop includes 10 code challenges that represent each of the OWASP's most common vulnerabilities. There will be given hints to help solve the vulnerabilities and pass the tests.The trainer will also provide detailed explanations, slides, and real-life examples in Node.js to help understand the problems better. Additionally, you'll gain insights from a Node.js Maintainer who will share how they manage security within a large project.It's suitable for Node.js Developers of all skill levels, from beginners to experts, it requires a general knowledge of web application and JavaScript.
Table of contents:- Broken Access Control- Cryptographic Failures- Injection- Insecure Design- Security Misconfiguration- Vulnerable and Outdated Components- Identification and Authentication Failures- Software and Data Integrity Failures- Security Logging and Monitoring Failures- Server-Side Request Forgery
How to Build Front-End Access Control with NFTs
JSNation 2024JSNation 2024
88 min
How to Build Front-End Access Control with NFTs
WorkshopFree
Solange Gueiros
Solange Gueiros
Understand the fundamentals of NFT technology and its application in bolstering web security. Through practical demonstrations and hands-on exercises, attendees will learn how to seamlessly integrate NFT-based access control mechanisms into their front-end development projects.
Finding, Hacking and fixing your NodeJS Vulnerabilities with Snyk
JSNation 2022JSNation 2022
99 min
Finding, Hacking and fixing your NodeJS Vulnerabilities with Snyk
Workshop
Matthew Salmon
Matthew Salmon
npm and security, how much do you know about your dependencies?Hack-along, live hacking of a vulnerable Node app https://github.com/snyk-labs/nodejs-goof, Vulnerabilities from both Open source and written code. Encouraged to download the application and hack along with us.Fixing the issues and an introduction to Snyk with a demo.Open questions.
Bring Code Quality and Security to your CI/CD pipeline
DevOps.js Conf 2022DevOps.js Conf 2022
76 min
Bring Code Quality and Security to your CI/CD pipeline
Workshop
Elena Vilchik
Elena Vilchik
In this workshop we will go through all the aspects and stages when integrating your project into Code Quality and Security Ecosystem. We will take a simple web-application as a starting point and create a CI pipeline triggering code quality monitoring for it. We will do a full development cycle starting from coding in the IDE and opening a Pull Request and I will show you how you can control the quality at those stages. At the end of the workshop you will be ready to enable such integration for your own projects.