@reliabilityworks/ruleset-sveltekit 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 +26 -0
package/package.json
ADDED
package/rules.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "sveltekit/csrf-checkorigin-false",
|
|
4
|
+
"severity": "high",
|
|
5
|
+
"title": "CSRF origin check disabled",
|
|
6
|
+
"description": "Disabling origin checks weakens default CSRF protections and can make cross-site request forgery easier.",
|
|
7
|
+
"matcher": {
|
|
8
|
+
"type": "regex",
|
|
9
|
+
"fileGlobs": ["**/svelte.config.{js,cjs,mjs,ts}"],
|
|
10
|
+
"pattern": "checkOrigin\\s*:\\s*false",
|
|
11
|
+
"message": "SvelteKit csrf.checkOrigin appears to be set to false."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "sveltekit/vite-server-host-all",
|
|
16
|
+
"severity": "medium",
|
|
17
|
+
"title": "Vite dev server bound to all interfaces",
|
|
18
|
+
"description": "Binding the dev server to 0.0.0.0 can expose it on the local network; ensure this is intentional.",
|
|
19
|
+
"matcher": {
|
|
20
|
+
"type": "regex",
|
|
21
|
+
"fileGlobs": ["**/vite.config.{js,cjs,mjs,ts}"],
|
|
22
|
+
"pattern": "\\bhost\\s*:\\s*['\"]0\\.0\\.0\\.0['\"]",
|
|
23
|
+
"message": "Vite server host appears to be set to 0.0.0.0."
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
]
|