fivosense 0.1.6 → 0.2.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/.kilo/skill/fivosense/skill.json +5 -5
- package/DEPLOYMENT_GUIDE.md +2 -2
- package/GITHUB_PUSH.md +4 -4
- package/LICENSE +1 -1
- package/README.md +290 -208
- package/RELEASE_READY.md +3 -3
- package/bin/fivosense.mjs +6 -0
- package/dist/ai/client.d.ts +6 -0
- package/dist/ai/client.d.ts.map +1 -1
- package/dist/ai/client.js +4 -1
- package/dist/ai/client.js.map +1 -1
- package/dist/ai/judge.d.ts +6 -0
- package/dist/ai/judge.d.ts.map +1 -1
- package/dist/ai/judge.js +6 -0
- package/dist/ai/judge.js.map +1 -1
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +6 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/core/orchestrator.d.ts +4 -1
- package/dist/core/orchestrator.d.ts.map +1 -1
- package/dist/core/orchestrator.js +6 -0
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/scope.d.ts +4 -1
- package/dist/core/scope.d.ts.map +1 -1
- package/dist/core/scope.js +6 -0
- package/dist/core/scope.js.map +1 -1
- package/dist/editors/vscode.d.ts +4 -2
- package/dist/editors/vscode.d.ts.map +1 -1
- package/dist/editors/vscode.js +6 -0
- package/dist/editors/vscode.js.map +1 -1
- package/dist/engine/adversary.d.ts +6 -0
- package/dist/engine/adversary.d.ts.map +1 -1
- package/dist/engine/adversary.js +4 -1
- package/dist/engine/adversary.js.map +1 -1
- package/dist/engine/graph.d.ts +4 -1
- package/dist/engine/graph.d.ts.map +1 -1
- package/dist/engine/graph.js +6 -0
- package/dist/engine/graph.js.map +1 -1
- package/dist/engine/poc.d.ts +6 -0
- package/dist/engine/poc.d.ts.map +1 -1
- package/dist/engine/poc.js +4 -1
- package/dist/engine/poc.js.map +1 -1
- package/dist/engine/reach.d.ts +4 -2
- package/dist/engine/reach.d.ts.map +1 -1
- package/dist/engine/reach.js +6 -0
- package/dist/engine/reach.js.map +1 -1
- package/dist/engine/sinks.d.ts +22 -32
- package/dist/engine/sinks.d.ts.map +1 -1
- package/dist/engine/sinks.js +338 -44
- package/dist/engine/sinks.js.map +1 -1
- package/dist/engine/sources.d.ts +11 -19
- package/dist/engine/sources.d.ts.map +1 -1
- package/dist/engine/sources.js +100 -24
- package/dist/engine/sources.js.map +1 -1
- package/dist/engine/taint.d.ts +6 -0
- package/dist/engine/taint.d.ts.map +1 -1
- package/dist/engine/taint.js +6 -0
- package/dist/engine/taint.js.map +1 -1
- package/dist/engine/verify.d.ts +4 -1
- package/dist/engine/verify.d.ts.map +1 -1
- package/dist/engine/verify.js +6 -0
- package/dist/engine/verify.js.map +1 -1
- package/dist/features/badge.d.ts +6 -0
- package/dist/features/badge.d.ts.map +1 -1
- package/dist/features/badge.js +4 -1
- package/dist/features/badge.js.map +1 -1
- package/dist/features/fix.d.ts +6 -0
- package/dist/features/fix.d.ts.map +1 -1
- package/dist/features/fix.js +4 -1
- package/dist/features/fix.js.map +1 -1
- package/dist/features/index.d.ts +6 -0
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +6 -0
- package/dist/features/index.js.map +1 -1
- package/dist/features/roast.d.ts +6 -0
- package/dist/features/roast.d.ts.map +1 -1
- package/dist/features/roast.js +4 -1
- package/dist/features/roast.js.map +1 -1
- package/dist/hooks/agent.d.ts +4 -1
- package/dist/hooks/agent.d.ts.map +1 -1
- package/dist/hooks/agent.js +6 -0
- package/dist/hooks/agent.js.map +1 -1
- package/dist/hooks/git.d.ts +4 -1
- package/dist/hooks/git.d.ts.map +1 -1
- package/dist/hooks/git.js +6 -0
- package/dist/hooks/git.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/rules/destructive.d.ts +12 -21
- package/dist/rules/destructive.d.ts.map +1 -1
- package/dist/rules/destructive.js +306 -24
- package/dist/rules/destructive.js.map +1 -1
- package/dist/rules/secrets.d.ts +8 -10
- package/dist/rules/secrets.d.ts.map +1 -1
- package/dist/rules/secrets.js +294 -17
- package/dist/rules/secrets.js.map +1 -1
- package/mcp/index.js +7 -0
- package/mcp/package-lock.json +2 -2
- package/mcp/package.json +21 -4
- package/package.json +5 -5
- package/src/ai/client.ts +7 -0
- package/src/ai/judge.ts +7 -0
- package/src/cli/index.ts +7 -1
- package/src/core/orchestrator.ts +7 -0
- package/src/core/scope.ts +7 -0
- package/src/editors/vscode.ts +7 -0
- package/src/engine/adversary.ts +7 -0
- package/src/engine/graph.ts +7 -0
- package/src/engine/poc.ts +7 -0
- package/src/engine/reach.ts +7 -0
- package/src/engine/sinks.ts +358 -45
- package/src/engine/sources.ts +109 -24
- package/src/engine/taint.ts +7 -0
- package/src/engine/verify.ts +7 -0
- package/src/features/badge.ts +7 -0
- package/src/features/fix.ts +7 -0
- package/src/features/index.ts +7 -0
- package/src/features/roast.ts +7 -0
- package/src/hooks/agent.ts +7 -0
- package/src/hooks/git.ts +7 -0
- package/src/index.ts +7 -0
- package/src/rules/destructive.ts +316 -26
- package/src/rules/secrets.ts +306 -17
- package/vscode-extension/CHANGELOG.md +14 -2
- package/vscode-extension/LICENSE +1 -1
- package/vscode-extension/README.md +28 -23
- package/vscode-extension/fivosense-vscode-0.1.1.vsix +0 -0
- package/vscode-extension/package-lock.json +6 -6
- package/vscode-extension/package.json +5 -3
package/src/engine/sources.ts
CHANGED
|
@@ -1,59 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FivoSense - AI Security Scanner
|
|
3
|
+
* Copyright (c) 2026 thevinsoni
|
|
4
|
+
* Licensed under the MIT License
|
|
5
|
+
* https://github.com/thevinsoni/sense
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
/**
|
|
2
9
|
* Catalog of untrusted input sources (taint origins)
|
|
3
10
|
* These represent user-controlled data that could be malicious
|
|
11
|
+
* 40+ patterns across 8 categories
|
|
4
12
|
*/
|
|
5
13
|
|
|
6
14
|
export interface SourcePattern {
|
|
7
15
|
pattern: string;
|
|
8
|
-
category: 'http' | 'file' | 'env' | 'cli' | 'external';
|
|
16
|
+
category: 'http' | 'file' | 'env' | 'cli' | 'external' | 'browser' | 'websocket' | 'process';
|
|
9
17
|
description: string;
|
|
10
18
|
severity: 'critical' | 'high' | 'medium';
|
|
11
19
|
}
|
|
12
20
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
// ============================================================
|
|
22
|
+
// HTTP/API sources — user input from web requests
|
|
23
|
+
// ============================================================
|
|
16
24
|
export const HTTP_SOURCES: SourcePattern[] = [
|
|
17
25
|
{ pattern: 'req.query', category: 'http', description: 'URL query parameters', severity: 'critical' },
|
|
18
26
|
{ pattern: 'req.params', category: 'http', description: 'Route parameters', severity: 'critical' },
|
|
19
27
|
{ pattern: 'req.body', category: 'http', description: 'Request body', severity: 'critical' },
|
|
20
28
|
{ pattern: 'req.headers', category: 'http', description: 'HTTP headers', severity: 'high' },
|
|
21
29
|
{ pattern: 'req.cookies', category: 'http', description: 'Cookies', severity: 'high' },
|
|
30
|
+
{ pattern: 'req.files', category: 'http', description: 'Uploaded files', severity: 'critical' },
|
|
31
|
+
{ pattern: 'req.file', category: 'http', description: 'Single uploaded file', severity: 'critical' },
|
|
32
|
+
{ pattern: 'req.ip', category: 'http', description: 'Client IP address', severity: 'medium' },
|
|
33
|
+
{ pattern: 'req.hostname', category: 'http', description: 'Request hostname', severity: 'medium' },
|
|
34
|
+
{ pattern: 'req.path', category: 'http', description: 'Request path', severity: 'high' },
|
|
35
|
+
{ pattern: 'req.url', category: 'http', description: 'Full request URL', severity: 'high' },
|
|
36
|
+
{ pattern: 'req.originalUrl', category: 'http', description: 'Original request URL', severity: 'high' },
|
|
37
|
+
{ pattern: 'req.get(', category: 'http', description: 'Get specific header', severity: 'high' },
|
|
38
|
+
{ pattern: 'req.header(', category: 'http', description: 'Get header value', severity: 'high' },
|
|
22
39
|
{ pattern: 'request.query', category: 'http', description: 'Query string', severity: 'critical' },
|
|
23
40
|
{ pattern: 'request.body', category: 'http', description: 'Request body', severity: 'critical' },
|
|
24
|
-
{ pattern: '
|
|
41
|
+
{ pattern: 'request.headers', category: 'http', description: 'Request headers', severity: 'high' },
|
|
42
|
+
{ pattern: 'request.params', category: 'http', description: 'Request params', severity: 'critical' },
|
|
43
|
+
{ pattern: 'ctx.request.body', category: 'http', description: 'Koa context body', severity: 'critical' },
|
|
25
44
|
{ pattern: 'ctx.query', category: 'http', description: 'Koa query', severity: 'critical' },
|
|
45
|
+
{ pattern: 'ctx.params', category: 'http', description: 'Koa params', severity: 'critical' },
|
|
46
|
+
{ pattern: 'ctx.headers', category: 'http', description: 'Koa headers', severity: 'high' },
|
|
47
|
+
{ pattern: 'event.body', category: 'http', description: 'Lambda event body', severity: 'critical' },
|
|
48
|
+
{ pattern: 'event.queryStringParameters', category: 'http', description: 'Lambda query params', severity: 'critical' },
|
|
49
|
+
{ pattern: 'event.pathParameters', category: 'http', description: 'Lambda path params', severity: 'critical' },
|
|
50
|
+
{ pattern: 'event.headers', category: 'http', description: 'Lambda headers', severity: 'high' },
|
|
26
51
|
];
|
|
27
52
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
53
|
+
// ============================================================
|
|
54
|
+
// File system sources — external file content
|
|
55
|
+
// ============================================================
|
|
31
56
|
export const FILE_SOURCES: SourcePattern[] = [
|
|
32
|
-
{ pattern: 'fs.readFileSync', category: 'file', description: '
|
|
33
|
-
{ pattern: 'fs.readFile', category: 'file', description: '
|
|
34
|
-
{ pattern: 'readFileSync', category: 'file', description: '
|
|
57
|
+
{ pattern: 'fs.readFileSync', category: 'file', description: 'Sync file read', severity: 'high' },
|
|
58
|
+
{ pattern: 'fs.readFile', category: 'file', description: 'Async file read', severity: 'high' },
|
|
59
|
+
{ pattern: 'readFileSync', category: 'file', description: 'Read file sync', severity: 'high' },
|
|
60
|
+
{ pattern: 'fs.createReadStream', category: 'file', description: 'Create read stream', severity: 'high' },
|
|
61
|
+
{ pattern: 'fs.promises.readFile', category: 'file', description: 'Promise file read', severity: 'high' },
|
|
62
|
+
{ pattern: 'fs.watch', category: 'file', description: 'File watch events', severity: 'medium' },
|
|
63
|
+
{ pattern: 'fs.watchFile', category: 'file', description: 'File watch', severity: 'medium' },
|
|
35
64
|
];
|
|
36
65
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
66
|
+
// ============================================================
|
|
67
|
+
// Environment/config sources
|
|
68
|
+
// ============================================================
|
|
40
69
|
export const ENV_SOURCES: SourcePattern[] = [
|
|
41
70
|
{ pattern: 'process.env', category: 'env', description: 'Environment variables', severity: 'medium' },
|
|
42
71
|
{ pattern: 'process.argv', category: 'cli', description: 'Command-line arguments', severity: 'high' },
|
|
72
|
+
{ pattern: 'process.stdin', category: 'process', description: 'Standard input', severity: 'high' },
|
|
73
|
+
{ pattern: 'process.cwd', category: 'process', description: 'Current working directory', severity: 'medium' },
|
|
74
|
+
{ pattern: 'process.platform', category: 'process', description: 'OS platform', severity: 'medium' },
|
|
75
|
+
{ pattern: 'process.arch', category: 'process', description: 'CPU architecture', severity: 'medium' },
|
|
76
|
+
{ pattern: 'process.env.PATH', category: 'env', description: 'PATH environment variable', severity: 'high' },
|
|
77
|
+
{ pattern: 'process.env.HOME', category: 'env', description: 'Home directory', severity: 'medium' },
|
|
78
|
+
{ pattern: 'process.env.USER', category: 'env', description: 'Current user', severity: 'medium' },
|
|
43
79
|
];
|
|
44
80
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export const
|
|
81
|
+
// ============================================================
|
|
82
|
+
// Browser sources — client-side user input
|
|
83
|
+
// ============================================================
|
|
84
|
+
export const BROWSER_SOURCES: SourcePattern[] = [
|
|
85
|
+
{ pattern: 'document.location', category: 'browser', description: 'Document location', severity: 'high' },
|
|
86
|
+
{ pattern: 'window.location', category: 'browser', description: 'Window location', severity: 'high' },
|
|
87
|
+
{ pattern: 'location.hash', category: 'browser', description: 'URL hash fragment', severity: 'high' },
|
|
88
|
+
{ pattern: 'location.search', category: 'browser', description: 'URL query string', severity: 'high' },
|
|
89
|
+
{ pattern: 'location.href', category: 'browser', description: 'Full URL', severity: 'high' },
|
|
90
|
+
{ pattern: 'document.referrer', category: 'browser', description: 'Referrer URL', severity: 'high' },
|
|
91
|
+
{ pattern: 'document.cookie', category: 'browser', description: 'Browser cookies', severity: 'high' },
|
|
92
|
+
{ pattern: 'document.URL', category: 'browser', description: 'Document URL', severity: 'high' },
|
|
93
|
+
{ pattern: 'localStorage.getItem', category: 'browser', description: 'LocalStorage data', severity: 'medium' },
|
|
94
|
+
{ pattern: 'sessionStorage.getItem', category: 'browser', description: 'SessionStorage data', severity: 'medium' },
|
|
95
|
+
{ pattern: 'window.name', category: 'browser', description: 'Window name', severity: 'medium' },
|
|
96
|
+
{ pattern: 'postMessage', category: 'browser', description: 'Cross-origin message', severity: 'high' },
|
|
97
|
+
{ pattern: 'addEventListener("message"', category: 'browser', description: 'Message event listener', severity: 'high' },
|
|
98
|
+
{ pattern: "addEventListener('message'", category: 'browser', description: 'Message event listener', severity: 'high' },
|
|
99
|
+
{ pattern: 'event.data', category: 'browser', description: 'Event data', severity: 'high' },
|
|
100
|
+
{ pattern: 'e.data', category: 'browser', description: 'Event data shorthand', severity: 'high' },
|
|
101
|
+
{ pattern: 'this.value', category: 'browser', description: 'Input element value', severity: 'high' },
|
|
102
|
+
{ pattern: 'target.value', category: 'browser', description: 'Event target value', severity: 'high' },
|
|
103
|
+
{ pattern: 'input.value', category: 'browser', description: 'Input field value', severity: 'high' },
|
|
104
|
+
{ pattern: 'textarea.value', category: 'browser', description: 'Textarea value', severity: 'high' },
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
// ============================================================
|
|
108
|
+
// WebSocket sources
|
|
109
|
+
// ============================================================
|
|
110
|
+
export const WEBSOCKET_SOURCES: SourcePattern[] = [
|
|
111
|
+
{ pattern: 'ws.on("message"', category: 'websocket', description: 'WebSocket message', severity: 'critical' },
|
|
112
|
+
{ pattern: "ws.on('message'", category: 'websocket', description: 'WebSocket message', severity: 'critical' },
|
|
113
|
+
{ pattern: 'socket.on("data"', category: 'websocket', description: 'Socket data', severity: 'critical' },
|
|
114
|
+
{ pattern: "socket.on('data'", category: 'websocket', description: 'Socket data', severity: 'critical' },
|
|
115
|
+
{ pattern: 'socket.on("message"', category: 'websocket', description: 'Socket message', severity: 'critical' },
|
|
116
|
+
{ pattern: "socket.on('message'", category: 'websocket', description: 'Socket message', severity: 'critical' },
|
|
117
|
+
{ pattern: 'wss.on("connection"', category: 'websocket', description: 'WebSocket connection', severity: 'high' },
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
// ============================================================
|
|
121
|
+
// External data sources
|
|
122
|
+
// ============================================================
|
|
123
|
+
export const EXTERNAL_SOURCES: SourcePattern[] = [
|
|
124
|
+
{ pattern: 'JSON.parse', category: 'external', description: 'JSON parse (external data)', severity: 'medium' },
|
|
125
|
+
{ pattern: 'URLSearchParams', category: 'external', description: 'URL search params', severity: 'high' },
|
|
126
|
+
{ pattern: 'FormData', category: 'external', description: 'Form data', severity: 'high' },
|
|
127
|
+
{ pattern: 'XMLHttpRequest', category: 'external', description: 'XHR response', severity: 'high' },
|
|
128
|
+
{ pattern: 'response.json()', category: 'external', description: 'Fetch JSON response', severity: 'high' },
|
|
129
|
+
{ pattern: 'response.text()', category: 'external', description: 'Fetch text response', severity: 'high' },
|
|
130
|
+
{ pattern: 'axios.interceptors', category: 'external', description: 'Axios interceptors', severity: 'medium' },
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
// ============================================================
|
|
134
|
+
// All sources combined
|
|
135
|
+
// ============================================================
|
|
136
|
+
export const ALL_SOURCES: SourcePattern[] = [
|
|
49
137
|
...HTTP_SOURCES,
|
|
50
138
|
...FILE_SOURCES,
|
|
51
139
|
...ENV_SOURCES,
|
|
140
|
+
...BROWSER_SOURCES,
|
|
141
|
+
...WEBSOCKET_SOURCES,
|
|
142
|
+
...EXTERNAL_SOURCES,
|
|
52
143
|
];
|
|
53
144
|
|
|
54
|
-
/**
|
|
55
|
-
* Check if a code string matches any source pattern
|
|
56
|
-
*/
|
|
57
145
|
export function isSource(code: string): SourcePattern | null {
|
|
58
146
|
for (const source of ALL_SOURCES) {
|
|
59
147
|
if (code.includes(source.pattern)) {
|
|
@@ -63,9 +151,6 @@ export function isSource(code: string): SourcePattern | null {
|
|
|
63
151
|
return null;
|
|
64
152
|
}
|
|
65
153
|
|
|
66
|
-
/**
|
|
67
|
-
* Get all sources matching a category
|
|
68
|
-
*/
|
|
69
154
|
export function getSourcesByCategory(category: SourcePattern['category']): SourcePattern[] {
|
|
70
155
|
return ALL_SOURCES.filter(s => s.category === category);
|
|
71
156
|
}
|
package/src/engine/taint.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FivoSense - AI Security Scanner
|
|
3
|
+
* Copyright (c) 2026 thevinsoni
|
|
4
|
+
* Licensed under the MIT License
|
|
5
|
+
* https://github.com/thevinsoni/sense
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
/**
|
|
2
9
|
* Taint Analysis - tracks data flow from sources to sinks
|
|
3
10
|
* Generates taint-trace proofs for each vulnerability
|
package/src/engine/verify.ts
CHANGED
package/src/features/badge.ts
CHANGED
package/src/features/fix.ts
CHANGED
package/src/features/index.ts
CHANGED
package/src/features/roast.ts
CHANGED
package/src/hooks/agent.ts
CHANGED
package/src/hooks/git.ts
CHANGED
package/src/index.ts
CHANGED