@fabriziosalmi/slopless 1.4.1
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/LICENSE +21 -0
- package/README.md +142 -0
- package/dist/engine/api.d.ts +16 -0
- package/dist/engine/api.js +543 -0
- package/dist/index.d.ts +122 -0
- package/dist/index.js +590 -0
- package/package.json +59 -0
- package/rules/VBC-001.yaml +33 -0
- package/rules/VBC-002.yaml +13 -0
- package/rules/VBC-003.yaml +36 -0
- package/rules/VBC-004.yaml +33 -0
- package/rules/VBC-005.yaml +24 -0
- package/rules/VBC-006.yaml +16 -0
- package/rules/VBC-007.yaml +28 -0
- package/rules/VBC-008.yaml +21 -0
- package/rules/VBC-009.yaml +24 -0
- package/rules/VBC-010.yaml +24 -0
- package/rules/VBC-011.yaml +21 -0
- package/rules/VBC-012.yaml +21 -0
- package/rules/VBC-013.yaml +17 -0
- package/rules/VBC-014.yaml +15 -0
- package/rules/VBC-015.yaml +40 -0
- package/rules/VBC-016.yaml +21 -0
- package/rules/VBC-017.yaml +23 -0
- package/rules/VBC-018.yaml +19 -0
- package/rules/VBC-019.yaml +42 -0
- package/rules/VBC-020.yaml +22 -0
- package/rules/VBC-021.yaml +22 -0
- package/rules/VBC-022.yaml +21 -0
- package/rules/VBC-023.yaml +22 -0
- package/rules/VBC-024.yaml +26 -0
- package/rules/VBC-025.yaml +13 -0
- package/rules/VBC-026.yaml +17 -0
- package/rules/VBC-027.yaml +27 -0
- package/rules/VBC-028.yaml +18 -0
- package/rules/VBC-029.yaml +22 -0
- package/rules/VBC-030.yaml +22 -0
- package/rules/VBC-032.yaml +20 -0
- package/rules/VBC-033.yaml +26 -0
- package/rules/VBC-034.yaml +41 -0
- package/rules/VBC-035.yaml +30 -0
- package/rules/VBC-039.yaml +18 -0
- package/rules/VBC-042.yaml +26 -0
- package/rules/VBC-045.yaml +13 -0
- package/rules/VBC-046.yaml +13 -0
- package/rules/VBC-048.yaml +23 -0
- package/rules/VBC-049.yaml +19 -0
- package/rules/VBC-051.yaml +23 -0
- package/rules/VBC-052.yaml +19 -0
- package/rules/VBC-053.yaml +19 -0
- package/rules/VBC-054.yaml +29 -0
- package/rules/VBC-056.yaml +28 -0
- package/rules/VBC-057.yaml +18 -0
- package/rules/VBC-058.yaml +18 -0
- package/rules/VBC-059.yaml +21 -0
- package/rules/VBC-063-B.yaml +15 -0
- package/rules/VBC-063.yaml +18 -0
- package/rules/VBC-065.yaml +33 -0
- package/rules/VBC-066.yaml +16 -0
- package/rules/VBC-068.yaml +21 -0
- package/rules/VBC-070.yaml +19 -0
- package/rules/VBC-077.yaml +35 -0
- package/rules/VBC-079.yaml +18 -0
- package/rules/VBC-080.yaml +18 -0
- package/rules/VBC-084.yaml +22 -0
- package/rules/VBC-086.yaml +22 -0
- package/rules/VBC-090.yaml +28 -0
- package/rules/VBC-096.yaml +19 -0
- package/rules/VBC-097.yaml +21 -0
- package/rules/VBC-098.yaml +18 -0
- package/rules/VBC-101.yaml +23 -0
- package/rules/VBC-102.yaml +20 -0
- package/rules/VBC-103.yaml +35 -0
- package/rules/VBC-104.yaml +24 -0
- package/rules/VBC-106.yaml +14 -0
- package/rules/VBC-112.yaml +20 -0
- package/rules/VBC-113.yaml +19 -0
- package/rules/VBC-117.yaml +21 -0
- package/rules/VBC-123.yaml +29 -0
- package/rules/VBC-131.yaml +20 -0
- package/rules/VBC-150.yaml +27 -0
- package/rules/VBC-153.yaml +21 -0
- package/rules/VBC-158.yaml +16 -0
- package/rules/VBC-161.yaml +27 -0
- package/rules/VBC-172.yaml +25 -0
- package/rules/VBC-197.yaml +22 -0
- package/rules/VBC-201.yaml +35 -0
- package/rules/VBC-206.yaml +19 -0
- package/rules/VBC-208.yaml +27 -0
- package/rules/VBC-212.yaml +19 -0
- package/rules/VBC-215.yaml +24 -0
- package/rules/VBC-305.yaml +20 -0
- package/rules/VBC-324.yaml +24 -0
- package/rules/VBC-334.yaml +23 -0
- package/rules/VBC-338.yaml +32 -0
- package/rules/VBC-340.yaml +22 -0
- package/rules/VBC-344.yaml +19 -0
- package/rules/VBC-347.yaml +21 -0
- package/rules/VBC-348.yaml +19 -0
- package/rules/VBC-385.yaml +21 -0
- package/rules/VBC-398.yaml +22 -0
- package/rules/VBC-401.yaml +12 -0
- package/rules/VBC-414.yaml +23 -0
- package/rules/VBC-421.yaml +20 -0
- package/rules/VBC-501.yaml +18 -0
- package/rules/VBC-502.yaml +23 -0
- package/rules/VBC-503.yaml +18 -0
- package/rules/VBC-504.yaml +20 -0
- package/rules/VBC-800.yaml +17 -0
- package/rules/VBC-901.yaml +48 -0
- package/rules/VBC-902.yaml +19 -0
- package/rules/VBC-903.yaml +17 -0
- package/rules/VBC-904.yaml +21 -0
- package/rules/VBC-905.yaml +17 -0
- package/rules/VBC-906.yaml +29 -0
- package/rules/VBC-907.yaml +24 -0
- package/rules/VBC-908.yaml +22 -0
- package/rules/VBC-909.yaml +21 -0
- package/rules/VBC-910.yaml +18 -0
- package/rules/VBC-911.yaml +21 -0
- package/rules/VBC-913.yaml +30 -0
- package/rules/VBC-914.yaml +31 -0
- package/rules/VBC-915.yaml +19 -0
- package/rules/VBC-916.yaml +24 -0
- package/rules/VBC-917.yaml +21 -0
- package/rules/VBC-918.yaml +22 -0
- package/rules/VBC-920.yaml +20 -0
- package/rules/VBC-921.yaml +45 -0
- package/rules/VBC-922.yaml +15 -0
- package/rules/VBC-923.yaml +15 -0
- package/rules/VBC-924.yaml +12 -0
- package/rules/VBC-925.yaml +14 -0
- package/rules/VBC-926.yaml +14 -0
- package/rules/VBC-927.yaml +24 -0
- package/rules/VBC-928.yaml +25 -0
- package/rules/VBC-929.yaml +21 -0
- package/rules/VBC-930.yaml +16 -0
- package/rules/VBC-931.yaml +16 -0
- package/rules/VBC-932.yaml +16 -0
- package/rules/VBC-933.yaml +28 -0
- package/rules/VBC-934.yaml +24 -0
- package/rules/VBC-935.yaml +26 -0
- package/rules/VBC-936.yaml +24 -0
- package/rules/VBC-937.yaml +24 -0
- package/rules/VBC-938.yaml +23 -0
- package/rules/VBC-939.yaml +23 -0
- package/rules/VBC-940.yaml +30 -0
- package/rules/VBC-941.yaml +28 -0
- package/rules/VBC-942.yaml +23 -0
- package/rules/VBC-943.yaml +22 -0
- package/rules/VBC-944.yaml +26 -0
- package/rules/VBC-945.yaml +33 -0
- package/rules/VBC-946.yaml +26 -0
- package/rules/VBC-947.yaml +22 -0
- package/rules/VBC-948.yaml +26 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
id: VBC-941
|
|
2
|
+
name: missing-input-sanitization
|
|
3
|
+
severity: warning
|
|
4
|
+
category: security
|
|
5
|
+
tags:
|
|
6
|
+
- security
|
|
7
|
+
- ai-error
|
|
8
|
+
match:
|
|
9
|
+
regex: >-
|
|
10
|
+
dangerouslySetInnerHTML\s*=\s*\{\{[^}]*__html\s*:\s*(?!\s|['\"`])|\.outerHTML\s*=(?!=)|\.insertAdjacentHTML\s*\(\s*[^,]+,\s*(?!\s|['\"`])
|
|
11
|
+
file_types:
|
|
12
|
+
- js
|
|
13
|
+
- ts
|
|
14
|
+
- jsx
|
|
15
|
+
- tsx
|
|
16
|
+
supersedes:
|
|
17
|
+
- VBC-070
|
|
18
|
+
message: >-
|
|
19
|
+
Unsanitized HTML sink at line {line}. dangerouslySetInnerHTML, outerHTML and insertAdjacentHTML
|
|
20
|
+
all bypass framework escaping. Sanitize with a library such as DOMPurify before assigning
|
|
21
|
+
untrusted markup.
|
|
22
|
+
tests:
|
|
23
|
+
fire:
|
|
24
|
+
- '<div dangerouslySetInnerHTML={{ __html: userHtml }} />'
|
|
25
|
+
- el.outerHTML = markup;
|
|
26
|
+
quiet:
|
|
27
|
+
- '<div dangerouslySetInnerHTML={{ __html: "<b>static</b>" }} />'
|
|
28
|
+
- el.textContent = text;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: VBC-942
|
|
2
|
+
name: missing-access-control
|
|
3
|
+
severity: warning
|
|
4
|
+
category: security
|
|
5
|
+
tags:
|
|
6
|
+
- security
|
|
7
|
+
- ai-error
|
|
8
|
+
match:
|
|
9
|
+
regex: >-
|
|
10
|
+
(?:router|app)\.(?:get|post|put|delete|patch)\s*\(\s*['\"][^'\"]+['\"]\s*,\s*(?:async\s+)?\(?\s*(?:req|request)\b[^)]*\)?\s*(?:=>|\{)
|
|
11
|
+
file_types:
|
|
12
|
+
- js
|
|
13
|
+
- ts
|
|
14
|
+
message: >-
|
|
15
|
+
Route handler at line {line} may be missing authentication middleware. AI-generated route
|
|
16
|
+
handlers frequently omit auth guards. Ensure every non-public endpoint is protected with
|
|
17
|
+
authentication and authorization middleware before the handler runs.
|
|
18
|
+
tests:
|
|
19
|
+
fire:
|
|
20
|
+
- router.get('/users', async (req, res) => res.json(users));
|
|
21
|
+
quiet:
|
|
22
|
+
- >-
|
|
23
|
+
router.get('/users', requireAuth, async (req, res) => res.json(users));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
id: VBC-943
|
|
2
|
+
name: ignored-catch-variable
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
- ai-error
|
|
8
|
+
match:
|
|
9
|
+
regex: catch\s*\(\s*_[a-zA-Z]?\s*\)\s*\{
|
|
10
|
+
file_types:
|
|
11
|
+
- js
|
|
12
|
+
- ts
|
|
13
|
+
message: >-
|
|
14
|
+
Catch clause with ignored error variable at line {line}. Using '_' as the catch binding
|
|
15
|
+
signals the exception is intentionally discarded. AI-generated code often silently suppresses
|
|
16
|
+
errors this way, hiding failures in production. Either log the error, re-throw with context,
|
|
17
|
+
or add an explicit comment explaining why suppression is safe here.
|
|
18
|
+
tests:
|
|
19
|
+
fire:
|
|
20
|
+
- try { risky(); } catch (_e) { fallback(); }
|
|
21
|
+
quiet:
|
|
22
|
+
- try { risky(); } catch (error) { report(error); }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
id: VBC-944
|
|
2
|
+
name: xss-href-injection
|
|
3
|
+
severity: error
|
|
4
|
+
category: security
|
|
5
|
+
tags:
|
|
6
|
+
- security
|
|
7
|
+
- ai-error
|
|
8
|
+
match:
|
|
9
|
+
regex: >-
|
|
10
|
+
href\s*=\s*\{[^}]*\+|href\s*=\s*[`'"][^`'"]*\$\{|href\s*=\s*\{\s*`[^`]*\$\{
|
|
11
|
+
scan: all
|
|
12
|
+
file_types:
|
|
13
|
+
- js
|
|
14
|
+
- ts
|
|
15
|
+
- jsx
|
|
16
|
+
- tsx
|
|
17
|
+
- html
|
|
18
|
+
message: >-
|
|
19
|
+
Dynamic href constructed with string interpolation at line {line}. If the value originates
|
|
20
|
+
from user input or an untrusted source, this is a javascript: URL injection vector. Validate
|
|
21
|
+
that URLs begin with http(s):// or are relative paths before assigning to href.
|
|
22
|
+
tests:
|
|
23
|
+
fire:
|
|
24
|
+
- const link = `href="${untrusted}"`;
|
|
25
|
+
quiet:
|
|
26
|
+
- <a href="/static/page">page</a>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
id: VBC-945
|
|
2
|
+
name: ai-generated-placeholder-comment
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
- ai-error
|
|
8
|
+
match:
|
|
9
|
+
regex: >-
|
|
10
|
+
//\s*(?:TODO|FIXME|NOTE)?\s*[:\-]?\s*(?:PLACEHOLDER|ADD YOUR|YOUR CODE HERE|implement
|
|
11
|
+
(?:this|later|me)|fill in|handle this|replace this|update this later|rest of the (?:code|logic)|and
|
|
12
|
+
so on)\b
|
|
13
|
+
flags: i
|
|
14
|
+
scan: comments
|
|
15
|
+
file_types:
|
|
16
|
+
- js
|
|
17
|
+
- ts
|
|
18
|
+
- py
|
|
19
|
+
- go
|
|
20
|
+
- java
|
|
21
|
+
supersedes:
|
|
22
|
+
- VBC-907
|
|
23
|
+
- VBC-150
|
|
24
|
+
message: >-
|
|
25
|
+
AI-generated placeholder comment '{match}' at line {line}. AI tools frequently emit skeleton
|
|
26
|
+
code with stub comments instead of real implementations. Replace with the actual logic or
|
|
27
|
+
open a tracked issue.
|
|
28
|
+
tests:
|
|
29
|
+
fire:
|
|
30
|
+
- '// TODO: implement this'
|
|
31
|
+
- // your code here
|
|
32
|
+
quiet:
|
|
33
|
+
- // parses the manifest and returns the entry point
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
id: VBC-946
|
|
2
|
+
name: no-verification-after-operation
|
|
3
|
+
severity: warning
|
|
4
|
+
category: correctness
|
|
5
|
+
tags:
|
|
6
|
+
- correctness
|
|
7
|
+
- ai-error
|
|
8
|
+
match:
|
|
9
|
+
regex: >-
|
|
10
|
+
await\s+\w+\.(delete|remove|drop|truncate|destroy|unlink|rmdir|rm)\s*\([^)]*\)\s*;(?!\s*(?:\/\/|if|const|let|var|throw|assert|expect|check|verify|log))
|
|
11
|
+
multiline: true
|
|
12
|
+
file_types:
|
|
13
|
+
- js
|
|
14
|
+
- ts
|
|
15
|
+
message: >-
|
|
16
|
+
Destructive async operation at line {line} with no verification of success. AI agents frequently
|
|
17
|
+
execute irreversible actions (delete, drop, rm) based on assumed success without checking
|
|
18
|
+
the return value or catching errors. Always verify the outcome of destructive operations
|
|
19
|
+
before proceeding.
|
|
20
|
+
tests:
|
|
21
|
+
fire:
|
|
22
|
+
- await db.delete(id);
|
|
23
|
+
quiet:
|
|
24
|
+
- |-
|
|
25
|
+
await db.delete(id);
|
|
26
|
+
if (!(await db.find(id))) throw new Error("gone");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
id: VBC-947
|
|
2
|
+
name: prototype-pollution-risk
|
|
3
|
+
severity: error
|
|
4
|
+
category: security
|
|
5
|
+
tags:
|
|
6
|
+
- security
|
|
7
|
+
- ai-error
|
|
8
|
+
match:
|
|
9
|
+
regex: >-
|
|
10
|
+
Object\.assign\s*\(\s*(?:req\.body|request\.body|params|query|body)\s*\)|_\.merge\s*\(\s*(?:req\.body|request\.body|params)\s*\)|Object\.assign\s*\(\s*\{\s*\}\s*,\s*(?:req\.body|request\.body)
|
|
11
|
+
file_types:
|
|
12
|
+
- js
|
|
13
|
+
- ts
|
|
14
|
+
message: >-
|
|
15
|
+
Merging untrusted request body directly at line {line}. This pattern enables prototype pollution:
|
|
16
|
+
an attacker can inject __proto__ or constructor.prototype to corrupt the application object
|
|
17
|
+
model. Validate and whitelist all accepted fields before merging user-supplied objects.
|
|
18
|
+
tests:
|
|
19
|
+
fire:
|
|
20
|
+
- Object.assign({}, req.body);
|
|
21
|
+
quiet:
|
|
22
|
+
- Object.assign({}, defaults, options);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
id: VBC-948
|
|
2
|
+
name: em-dash-prose
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- docs
|
|
7
|
+
- ai-slop
|
|
8
|
+
match:
|
|
9
|
+
regex: —
|
|
10
|
+
file_types:
|
|
11
|
+
- md
|
|
12
|
+
- txt
|
|
13
|
+
opt_in: true
|
|
14
|
+
message: >-
|
|
15
|
+
Em dash at line {line}. They cluster heavily in generated prose, so a reader looking for
|
|
16
|
+
the seams finds them here first. If the break is explanatory use a colon, if it qualifies
|
|
17
|
+
use a comma, if it is an aside use parentheses, and if the two halves are separate thoughts
|
|
18
|
+
use a full stop. Keep it only where you chose it deliberately.
|
|
19
|
+
tests:
|
|
20
|
+
fire:
|
|
21
|
+
- The scanner failed — silently.
|
|
22
|
+
- Four scopes — code, strings, comments, all — cover every case.
|
|
23
|
+
quiet:
|
|
24
|
+
- The scanner failed, silently.
|
|
25
|
+
- Four scopes (code, strings, comments, all) cover every case.
|
|
26
|
+
- Copyright 2020–2026 Acme Ltd.
|