@reliabilityworks/ruleset-express 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -0
- package/rules.json +39 -0
package/package.json
ADDED
package/rules.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "express/cors-wildcard-origin",
|
|
4
|
+
"severity": "high",
|
|
5
|
+
"title": "CORS allows any origin",
|
|
6
|
+
"description": "Allowing origin '*' can enable unwanted cross-origin access if credentials or sensitive endpoints are involved.",
|
|
7
|
+
"matcher": {
|
|
8
|
+
"type": "regex",
|
|
9
|
+
"fileGlobs": ["**/*.{js,jsx,ts,tsx}"],
|
|
10
|
+
"pattern": "\\borigin\\s*:\\s*['\"]\\*['\"]",
|
|
11
|
+
"message": "CORS origin appears to be configured as '*'."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "express/allow-origin-star-header",
|
|
16
|
+
"severity": "high",
|
|
17
|
+
"title": "Access-Control-Allow-Origin header set to '*'",
|
|
18
|
+
"description": "Setting Access-Control-Allow-Origin to '*' can expose endpoints to cross-origin callers.",
|
|
19
|
+
"matcher": {
|
|
20
|
+
"type": "regex",
|
|
21
|
+
"fileGlobs": ["**/*.{js,jsx,ts,tsx}"],
|
|
22
|
+
"pattern": "Access-Control-Allow-Origin\\s*['\"]?\\s*,\\s*['\"]\\*['\"]",
|
|
23
|
+
"message": "Access-Control-Allow-Origin appears to be set to '*'."
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "express/session-cookie-secure-false",
|
|
28
|
+
"severity": "high",
|
|
29
|
+
"title": "Session cookie configured with secure: false",
|
|
30
|
+
"description": "Session cookies without secure flag can be sent over HTTP, increasing the risk of session theft on insecure networks.",
|
|
31
|
+
"matcher": {
|
|
32
|
+
"type": "regex",
|
|
33
|
+
"fileGlobs": ["**/*.{js,jsx,ts,tsx}"],
|
|
34
|
+
"pattern": "cookie\\s*:\\s*\\{[^}]*\\bsecure\\s*:\\s*false",
|
|
35
|
+
"flags": "s",
|
|
36
|
+
"message": "Session cookie appears to set secure: false."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]
|