You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cd1af84
Browse filesBrowse the repository at this point in the historyBrowse files
- punctuation inside quotes
- spell out acronyms on first use
- Node.js, not Node
- sentence-case title
- "application" consistently
- serial comma in heading
Express intentionally leaves most security decisions up to application developers. This page is a checklist of those decisions, to use while building or deploying an Express application.
9
9
10
-
Not every item will apply to your application, but consider each question before going to production. For items that apply, a "no", or a question you don't understand, means there is a fix to make or a topic to look at more closely. Each question links to a page covering what Express does, what can go wrong, and what to do about it. Questions without links are out of scope of Express itself or its family of middleware. The questions are ordered roughly by when you meet them while building an application.
10
+
Not every item will apply to your application, but consider each question before going to production. For items that apply, a "no," or a question you don't understand, means there is a fix to make or a topic to look at more closely. Each question links to a page covering what Express does, what can go wrong, and what to do about it. Questions without links are out of scope of Express itself or its family of middleware. The questions are ordered roughly by when you meet them while building an application.
11
11
12
-
This list is a gift to the Express community, from the community. It is not complete, and it is not a substitute for a general web security checklist. [OWASP](https://owasp.org/) covers the things this guide won't.
12
+
This list is a gift to the Express community, from the community. It is not complete, and it is not a substitute for a general web security checklist. The [Open Worldwide Application Security Project (OWASP)](https://owasp.org/) covers the things this guide won't.
13
13
14
14
## What you should already know
15
15
@@ -23,7 +23,7 @@ This documentation focuses on the risks and mitigations specific to Express rath
23
23
24
24
## Express threat model
25
25
26
-
You might ask yourself "if I have to do all this work to secure my application, does that mean Express isn't secure?". Fair question!
26
+
You might ask yourself "if I have to do all this work to secure my application, does that mean Express isn't secure?" Fair question!
27
27
28
28
The Express project takes responsibility for the security of its own code through ongoing security reviews, vulnerability reports, and fixes. Developers are responsible for the security of the applications they build with it, including how they configure and use Express and its middleware. The [Express threat model](https://github.com/expressjs/security-wg/blob/main/docs/ThreatModel.md) explains where that boundary sits.
29
29
@@ -36,8 +36,8 @@ If you believe you have discovered a security vulnerability in Express, please s
36
36
## Before you write a route
37
37
38
38
- Are you on a [supported Express release](/support)?
39
-
- Do you know where TLS terminates in front of your app?
40
-
- Does CI run `npm audit` or an equivalent, and does someone act on it?
39
+
- Do you know where Transport Layer Security (TLS) terminates in front of your application?
40
+
- Does continuous integration (CI) run `npm audit` or an equivalent, and does someone act on it?
41
41
- Are you watching [Express releases](https://github.com/expressjs/express/releases) and [security advisories](https://github.com/expressjs/express/security/advisories)?
42
42
43
43
## Untrusted input
@@ -50,7 +50,7 @@ If you believe you have discovered a security vulnerability in Express, please s
50
50
51
51
- Are your route patterns free of [repetition that can be forced into catastrophic backtracking](/security/route-patterns)?
52
52
- Is authentication and authorization middleware [mounted before every route it protects](/security/route-patterns)?
53
-
- Does anything in front of the app that filters by path [match Express's routing rules](/security/route-patterns)?
53
+
- Does anything in front of the application that filters by path [match Express's routing rules](/security/route-patterns)?
54
54
55
55
## Response sinks
56
56
@@ -67,8 +67,8 @@ If you believe you have discovered a security vulnerability in Express, please s
67
67
68
68
## Proxies and client identity
69
69
70
-
- Is `trust proxy`[set to match your deployment](/security/proxies), and never `true` when a client can reach the app directly?
71
-
- If your app is behind a proxy, is [`trust proxy` configured](/security/proxies) so features using `req.ip`, `req.hostname`, or `req.protocol` receive the correct client information?
70
+
- Is `trust proxy`[set to match your deployment](/security/proxies), and never `true` when a client can reach the application directly?
71
+
- If your application is behind a proxy, is [`trust proxy` configured](/security/proxies) so features using `req.ip`, `req.hostname`, or `req.protocol` receive the correct client information?
72
72
73
73
## Error handling
74
74
@@ -80,15 +80,15 @@ If you believe you have discovered a security vulnerability in Express, please s
80
80
81
81
- Does every body parser have a [`limit` that matches what the route expects](/security/resource-exhaustion)?
82
82
- Is there [rate limiting on login and other expensive endpoints](/security/resource-exhaustion)?
83
-
- Are [server timeouts set](/security/resource-exhaustion), or is something in front of Node absorbing slow clients?
83
+
- Are [server timeouts set](/security/resource-exhaustion), or is something in front of Node.js absorbing slow clients?
84
84
85
-
## Sessions, cookies, CSRF, CORS
85
+
## Sessions, cookies, CSRF, and CORS
86
86
87
87
- Are cookies set with [`Secure`, `HttpOnly`, and `SameSite`](/security/sessions)?
88
88
- Is the [cookie signing secret](/security/sessions) loaded from the environment rather than source?
89
89
- Is the [session store](/security/sessions) something other than `MemoryStore` in production?
90
-
- Do cookie-authenticated routes that change state have [CSRF protection](/security/csrf)?
91
-
- Does CORS use an [explicit origin allowlist](/security/cors)?
90
+
- Do cookie-authenticated routes that change state have [cross-site request forgery (CSRF) protection](/security/csrf)?
91
+
- Does cross-origin resource sharing (CORS) use an [explicit origin allowlist](/security/cors)?
0 commit comments