kuzushi 0.2.0 → 0.9.2
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/README.md +2 -0
- package/dist/agent-runtime/claude.js +15 -3
- package/dist/agent-runtime/claude.js.map +1 -1
- package/dist/agents/tasks/code-config-detect.js +3 -0
- package/dist/agents/tasks/code-config-detect.js.map +1 -1
- package/dist/agents/tasks/command-injection.js +10 -8
- package/dist/agents/tasks/command-injection.js.map +1 -1
- package/dist/agents/tasks/context-enricher.js +2 -0
- package/dist/agents/tasks/context-enricher.js.map +1 -1
- package/dist/agents/tasks/deserialization-detection.js +4 -1
- package/dist/agents/tasks/deserialization-detection.js.map +1 -1
- package/dist/agents/tasks/graphql-security.js +4 -1
- package/dist/agents/tasks/graphql-security.js.map +1 -1
- package/dist/agents/tasks/nosql-injection.js +6 -3
- package/dist/agents/tasks/nosql-injection.js.map +1 -1
- package/dist/agents/tasks/prototype-pollution.js +4 -1
- package/dist/agents/tasks/prototype-pollution.js.map +1 -1
- package/dist/agents/tasks/race-condition.js +4 -1
- package/dist/agents/tasks/race-condition.js.map +1 -1
- package/dist/agents/tasks/secrets-crypto-detect.js +3 -0
- package/dist/agents/tasks/secrets-crypto-detect.js.map +1 -1
- package/dist/agents/tasks/sharp-edges-detect.js +5 -0
- package/dist/agents/tasks/sharp-edges-detect.js.map +1 -1
- package/dist/agents/tasks/ssrf-detection.js +6 -1
- package/dist/agents/tasks/ssrf-detection.js.map +1 -1
- package/dist/agents/tasks/supply-chain.js +4 -1
- package/dist/agents/tasks/supply-chain.js.map +1 -1
- package/dist/agents/tasks/template-injection.js +6 -3
- package/dist/agents/tasks/template-injection.js.map +1 -1
- package/dist/agents/tasks/threat-modeling/randori-adapter.js +19 -2
- package/dist/agents/tasks/threat-modeling/randori-adapter.js.map +1 -1
- package/dist/agents/tasks/threat-modeling/randori-artifacts.js +69 -13
- package/dist/agents/tasks/threat-modeling/randori-artifacts.js.map +1 -1
- package/dist/agents/tasks/threat-modeling/randori.js +70 -30
- package/dist/agents/tasks/threat-modeling/randori.js.map +1 -1
- package/dist/agents/tasks/xxe-detection.js +4 -1
- package/dist/agents/tasks/xxe-detection.js.map +1 -1
- package/dist/cli/commands/scan.js +35 -5
- package/dist/cli/commands/scan.js.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/migrations/024_rename_scanner_to_task_id.d.ts +13 -0
- package/dist/migrations/024_rename_scanner_to_task_id.js +25 -0
- package/dist/migrations/024_rename_scanner_to_task_id.js.map +1 -0
- package/dist/migrations/index.js +2 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/runner.js +7 -0
- package/dist/migrations/runner.js.map +1 -1
- package/dist/prompts/language-tuning.d.ts +38 -0
- package/dist/prompts/language-tuning.js +225 -0
- package/dist/prompts/language-tuning.js.map +1 -0
- package/dist/prompts/languages/c-cpp.d.ts +2 -0
- package/dist/prompts/languages/c-cpp.js +276 -0
- package/dist/prompts/languages/c-cpp.js.map +1 -0
- package/dist/prompts/languages/go.d.ts +2 -0
- package/dist/prompts/languages/go.js +252 -0
- package/dist/prompts/languages/go.js.map +1 -0
- package/dist/prompts/languages/index.d.ts +6 -0
- package/dist/prompts/languages/index.js +44 -0
- package/dist/prompts/languages/index.js.map +1 -0
- package/dist/prompts/languages/java-kotlin.d.ts +2 -0
- package/dist/prompts/languages/java-kotlin.js +495 -0
- package/dist/prompts/languages/java-kotlin.js.map +1 -0
- package/dist/prompts/languages/javascript-typescript.d.ts +2 -0
- package/dist/prompts/languages/javascript-typescript.js +421 -0
- package/dist/prompts/languages/javascript-typescript.js.map +1 -0
- package/dist/prompts/languages/php.d.ts +2 -0
- package/dist/prompts/languages/php.js +277 -0
- package/dist/prompts/languages/php.js.map +1 -0
- package/dist/prompts/languages/python.d.ts +2 -0
- package/dist/prompts/languages/python.js +283 -0
- package/dist/prompts/languages/python.js.map +1 -0
- package/dist/prompts/languages/ruby.d.ts +2 -0
- package/dist/prompts/languages/ruby.js +219 -0
- package/dist/prompts/languages/ruby.js.map +1 -0
- package/dist/prompts/languages/rust.d.ts +2 -0
- package/dist/prompts/languages/rust.js +149 -0
- package/dist/prompts/languages/rust.js.map +1 -0
- package/dist/prompts/languages/types.d.ts +79 -0
- package/dist/prompts/languages/types.js +9 -0
- package/dist/prompts/languages/types.js.map +1 -0
- package/dist/scanners/run-agentic.d.ts +2 -2
- package/dist/scanners/run-agentic.js +11 -3
- package/dist/scanners/run-agentic.js.map +1 -1
- package/dist/store.js +4 -0
- package/dist/store.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
// NOTE: This file contains DETECTION PATTERNS for a security scanner.
|
|
2
|
+
// The API references are DETECTION TARGETS describing what the scanner
|
|
3
|
+
// looks for in scanned codebases, not code this file executes.
|
|
4
|
+
export const jstsProfile = {
|
|
5
|
+
languageId: "JavaScript/TypeScript",
|
|
6
|
+
aliases: ["javascript", "typescript", "js", "ts", "jsx", "tsx", "node", "nodejs"],
|
|
7
|
+
generalHints: {
|
|
8
|
+
grepPatterns: [
|
|
9
|
+
"require\\(",
|
|
10
|
+
"import\\s+.*from",
|
|
11
|
+
"express\\(",
|
|
12
|
+
"app\\.(get|post|put|delete|patch|use)\\(",
|
|
13
|
+
"createServer\\(",
|
|
14
|
+
"next\\.config",
|
|
15
|
+
"getServerSideProps",
|
|
16
|
+
"getStaticProps",
|
|
17
|
+
"React\\.createElement",
|
|
18
|
+
"useEffect\\(",
|
|
19
|
+
],
|
|
20
|
+
fileHints: [
|
|
21
|
+
"package.json for dependency versions and scripts",
|
|
22
|
+
".env / .env.local for environment variable definitions",
|
|
23
|
+
"next.config.js / next.config.mjs for Next.js configuration",
|
|
24
|
+
"middleware.ts / middleware.js for Next.js/Express middleware",
|
|
25
|
+
"server.js / app.js / index.js for Express server setup",
|
|
26
|
+
"routes/ or pages/ directories for route definitions",
|
|
27
|
+
"lib/auth or utils/auth for authentication logic",
|
|
28
|
+
],
|
|
29
|
+
instructions: [
|
|
30
|
+
"Run npm audit / pnpm audit mentally — check package.json for known-vulnerable dependency versions",
|
|
31
|
+
"Review middleware chains in Express (app.use ordering) and Next.js (middleware.ts matcher config)",
|
|
32
|
+
"Check for missing CSRF protection on state-changing routes",
|
|
33
|
+
"Inspect .env files for secrets and verify they are in .gitignore",
|
|
34
|
+
"Look for API routes that bypass authentication middleware",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
generalAntiHallucination: [
|
|
38
|
+
"Parameterized queries via ORMs (Prisma, Sequelize, TypeORM, Knex with bindings) are SAFE against SQL injection — do NOT flag them",
|
|
39
|
+
"React JSX interpolation {variable} auto-escapes by default — this prevents XSS unless dangerouslySetInnerHTML is used",
|
|
40
|
+
"parseInt() and Number() are type coercion, NOT injection vectors — do NOT flag them as dangerous sinks",
|
|
41
|
+
],
|
|
42
|
+
vulnClasses: {
|
|
43
|
+
"prototype-pollution": {
|
|
44
|
+
sinks: [
|
|
45
|
+
{ api: "lodash.merge(target, userObj)", risk: "Deep merge copies __proto__ or constructor.prototype properties from attacker-controlled object", cwes: ["CWE-1321"] },
|
|
46
|
+
{ api: "lodash.defaultsDeep(target, userObj)", risk: "Recursive default assignment traverses __proto__ chain from untrusted input", cwes: ["CWE-1321"] },
|
|
47
|
+
{ api: "_.extend(target, userObj) / $.extend(true, target, userObj)", risk: "Deep extend copies prototype-polluting keys from user objects", cwes: ["CWE-1321"] },
|
|
48
|
+
{ api: "Object.assign(target, userObj) with nested user objects", risk: "Shallow copy can still overwrite properties if target is Object.prototype via crafted key path", cwes: ["CWE-1321"] },
|
|
49
|
+
{ api: "Custom recursive merge/deepMerge functions", risk: "Hand-rolled deep merge without __proto__/constructor filtering", cwes: ["CWE-1321"] },
|
|
50
|
+
],
|
|
51
|
+
safePatterns: [
|
|
52
|
+
{ api: "Object.assign({}, userObj)", why: "Shallow copy into a new empty object — does not pollute existing prototypes" },
|
|
53
|
+
{ api: "structuredClone(userObj)", why: "Structured clone strips prototype chain — safe deep copy" },
|
|
54
|
+
{ api: "JSON.parse(JSON.stringify(obj))", why: "Round-trip strips __proto__ keys and prototype references" },
|
|
55
|
+
{ api: "Map/Set instead of plain objects for dynamic keys", why: "Map does not have a prototype chain vulnerable to pollution" },
|
|
56
|
+
],
|
|
57
|
+
investigationHints: {
|
|
58
|
+
grepPatterns: [
|
|
59
|
+
"\\.merge\\(",
|
|
60
|
+
"\\.extend\\(",
|
|
61
|
+
"Object\\.assign\\(",
|
|
62
|
+
"defaultsDeep\\(",
|
|
63
|
+
"deepMerge\\(",
|
|
64
|
+
"deepExtend\\(",
|
|
65
|
+
"__proto__",
|
|
66
|
+
"constructor\\[",
|
|
67
|
+
],
|
|
68
|
+
fileHints: [
|
|
69
|
+
"Utility/helper files with merge or extend functions",
|
|
70
|
+
"Configuration loaders that merge user-supplied config objects",
|
|
71
|
+
"API route handlers that spread or merge request body into objects",
|
|
72
|
+
"Middleware that parses and merges query parameters or headers",
|
|
73
|
+
],
|
|
74
|
+
instructions: [
|
|
75
|
+
"Check if the source object in any merge/extend call originates from user input (req.body, req.query, parsed JSON)",
|
|
76
|
+
"Look for custom deep merge utilities — do they filter __proto__, constructor, and prototype keys?",
|
|
77
|
+
"Check lodash version — versions before 4.17.12 have known prototype pollution in merge/defaultsDeep",
|
|
78
|
+
"Inspect config merging logic where user-supplied options are merged with defaults",
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
fewShots: [
|
|
82
|
+
{
|
|
83
|
+
scenario: "Lodash merge with user-controlled request body",
|
|
84
|
+
vulnerableCode: 'const _ = require("lodash");\napp.post("/settings", (req, res) => {\n const defaults = { theme: "light", lang: "en" };\n const settings = _.merge(defaults, req.body);\n res.json(settings);\n});',
|
|
85
|
+
explanation: 'req.body is attacker-controlled. Sending {"__proto__": {"isAdmin": true}} pollutes Object.prototype so every object in the process inherits isAdmin=true.',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
frameworkGuidance: [
|
|
89
|
+
{
|
|
90
|
+
framework: "Express",
|
|
91
|
+
defaults: ["Express does not provide built-in protection against prototype pollution"],
|
|
92
|
+
pitfalls: ["Body parsers (express.json()) pass parsed JSON directly — __proto__ keys are preserved", "Middleware that merges req.body into config objects"],
|
|
93
|
+
configChecks: ["Check if body parser has a reviver that strips __proto__ keys"],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
antiHallucinationExtra: [
|
|
97
|
+
"Object.assign({}, obj) with a fresh empty target is SAFE — it does not pollute prototypes",
|
|
98
|
+
"Shallow spread ({...obj}) is SAFE against prototype pollution — only deep recursive operations are dangerous",
|
|
99
|
+
"JSON.parse does NOT preserve __proto__ as a prototype link — it becomes a regular property name",
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
"command-injection": {
|
|
103
|
+
sinks: [
|
|
104
|
+
{ api: "child_process.exec(cmd)", risk: "Passes cmd to /bin/sh — full shell interpretation of user-controlled strings", shellInvoking: true, cwes: ["CWE-78"] },
|
|
105
|
+
{ api: "child_process.execSync(cmd)", risk: "Synchronous shell execution — same risk as exec", shellInvoking: true, cwes: ["CWE-78"] },
|
|
106
|
+
{ api: "child_process.spawn(cmd, { shell: true })", risk: "spawn with shell option enables shell interpretation", shellInvoking: true, cwes: ["CWE-78"] },
|
|
107
|
+
{ api: "eval(userStr)", risk: "Executes arbitrary JavaScript code from string", shellInvoking: false, cwes: ["CWE-94"] },
|
|
108
|
+
{ api: "new Function(userStr)", risk: "Compiles and executes arbitrary JavaScript from string", shellInvoking: false, cwes: ["CWE-94"] },
|
|
109
|
+
{ api: "vm.runInNewContext(userStr)", risk: "Executes code in a V8 context — sandbox escapes are well-documented", shellInvoking: false, cwes: ["CWE-94"] },
|
|
110
|
+
],
|
|
111
|
+
safePatterns: [
|
|
112
|
+
{ api: "child_process.execFile(bin, [arg1, arg2])", why: "No shell invocation — arguments are passed directly to the binary" },
|
|
113
|
+
{ api: "child_process.spawn(bin, [arg1, arg2])", why: "Without shell option, no shell metacharacter interpretation" },
|
|
114
|
+
{ api: "All hardcoded arguments to exec/spawn", why: "No attacker-controlled data in command or arguments" },
|
|
115
|
+
],
|
|
116
|
+
investigationHints: {
|
|
117
|
+
grepPatterns: [
|
|
118
|
+
"child_process",
|
|
119
|
+
"\\.exec\\(",
|
|
120
|
+
"execSync\\(",
|
|
121
|
+
"\\.spawn\\(",
|
|
122
|
+
"shell:\\s*true",
|
|
123
|
+
"\\beval\\(",
|
|
124
|
+
"new Function\\(",
|
|
125
|
+
],
|
|
126
|
+
fileHints: [
|
|
127
|
+
"Build scripts and task runners",
|
|
128
|
+
"API routes that invoke system tools (ffmpeg, imagemagick, git, pandoc)",
|
|
129
|
+
"CI/CD helper scripts",
|
|
130
|
+
"File conversion or processing endpoints",
|
|
131
|
+
],
|
|
132
|
+
instructions: [
|
|
133
|
+
"Check if exec/execSync calls use template literals or string concatenation with user-supplied data",
|
|
134
|
+
"Look for spawn calls with the shell option set to true — this negates spawn's argument-array safety",
|
|
135
|
+
"Inspect eval() and new Function() — trace the string argument back to its source",
|
|
136
|
+
"Check for indirect eval via setTimeout(string) or setInterval(string) with user data",
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
fewShots: [
|
|
140
|
+
{
|
|
141
|
+
scenario: "Express route using exec with template literal from user input",
|
|
142
|
+
vulnerableCode: 'const { exec } = require("child_process");\napp.get("/convert", (req, res) => {\n const filename = req.query.file;\n exec(`convert ${filename} output.png`, (err, stdout) => {\n res.send(stdout);\n });\n});',
|
|
143
|
+
explanation: "filename comes from req.query.file (attacker-controlled). Sending 'img.png; cat /etc/passwd' executes the injected command via shell interpretation.",
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
frameworkGuidance: [
|
|
147
|
+
{
|
|
148
|
+
framework: "Express",
|
|
149
|
+
defaults: ["Express does not invoke shell commands — but route handlers often do for file processing"],
|
|
150
|
+
pitfalls: ["Routes that call exec/execSync with user-controlled query params or body fields", "Middleware that shells out to system tools for request processing"],
|
|
151
|
+
configChecks: ["Check for helmet or other security middleware that might limit exposure"],
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
antiHallucinationExtra: [
|
|
155
|
+
"child_process.execFile() and spawn() without shell option are SAFE against shell metacharacter injection — do NOT flag them",
|
|
156
|
+
"Do NOT flag exec/spawn calls where all arguments are hardcoded strings with no user data",
|
|
157
|
+
"setTimeout(function, ms) with a function reference (not string) is SAFE — only setTimeout('string') is dangerous",
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
ssrf: {
|
|
161
|
+
sinks: [
|
|
162
|
+
{ api: "fetch(url)", risk: "Native fetch with user-controlled URL can target internal services", cwes: ["CWE-918"] },
|
|
163
|
+
{ api: "axios.get(url) / axios(url)", risk: "HTTP client with user-controlled URL — follows redirects by default", cwes: ["CWE-918"] },
|
|
164
|
+
{ api: "http.request(url)", risk: "Node.js built-in HTTP client with no URL validation", cwes: ["CWE-918"] },
|
|
165
|
+
{ api: "got(url)", risk: "HTTP client with user-controlled URL — follows redirects by default", cwes: ["CWE-918"] },
|
|
166
|
+
{ api: "node-fetch(url)", risk: "Polyfill fetch with user-controlled URL", cwes: ["CWE-918"] },
|
|
167
|
+
],
|
|
168
|
+
safePatterns: [
|
|
169
|
+
{ api: "Hardcoded URLs with user data in body/params only", why: "URL is fixed — user controls only payload, not destination" },
|
|
170
|
+
{ api: "URL validated against allowlist of domains/IPs", why: "Only permitted destinations are reachable" },
|
|
171
|
+
{ api: "Outbound proxy with internal network blocking", why: "Network-level control prevents access to internal services" },
|
|
172
|
+
],
|
|
173
|
+
investigationHints: {
|
|
174
|
+
grepPatterns: [
|
|
175
|
+
"\\bfetch\\(",
|
|
176
|
+
"axios\\(",
|
|
177
|
+
"axios\\.(get|post|put|delete)\\(",
|
|
178
|
+
"http\\.request\\(",
|
|
179
|
+
"https\\.request\\(",
|
|
180
|
+
"\\bgot\\(",
|
|
181
|
+
"node-fetch",
|
|
182
|
+
],
|
|
183
|
+
fileHints: [
|
|
184
|
+
"Webhook registration or callback endpoints",
|
|
185
|
+
"URL preview/unfurl/screenshot features",
|
|
186
|
+
"Proxy or redirect endpoints",
|
|
187
|
+
"File download or import-from-URL features",
|
|
188
|
+
"API routes that fetch external resources on behalf of users",
|
|
189
|
+
],
|
|
190
|
+
instructions: [
|
|
191
|
+
"Check if the URL parameter originates from user input (req.query, req.body, database field set by user)",
|
|
192
|
+
"Look for URL validation that can be bypassed — startsWith('https://') does NOT prevent https://169.254.169.254",
|
|
193
|
+
"Check if the HTTP client follows redirects — a redirect from an allowed domain to an internal IP bypasses allowlists",
|
|
194
|
+
"Cloud metadata: can the URL reach 169.254.169.254 (AWS), metadata.google.internal (GCP), or 169.254.169.254 (Azure)?",
|
|
195
|
+
"Check for DNS rebinding — URL resolves to allowed IP on first check but internal IP on actual request",
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
fewShots: [
|
|
199
|
+
{
|
|
200
|
+
scenario: "Proxy endpoint passing user-supplied URL to fetch",
|
|
201
|
+
vulnerableCode: 'app.get("/proxy", async (req, res) => {\n const url = req.query.url;\n const response = await fetch(url);\n const data = await response.text();\n res.send(data);\n});',
|
|
202
|
+
explanation: "url is entirely attacker-controlled from req.query.url. Attacker sends http://169.254.169.254/latest/meta-data/iam/security-credentials/ to steal cloud credentials.",
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
frameworkGuidance: [
|
|
206
|
+
{
|
|
207
|
+
framework: "Next.js",
|
|
208
|
+
defaults: ["Next.js API routes and Server Actions can make server-side HTTP requests"],
|
|
209
|
+
pitfalls: ["getServerSideProps that fetch user-supplied URLs", "API routes acting as proxy endpoints", "Image optimization (next/image) with unvalidated remote patterns"],
|
|
210
|
+
configChecks: ["Check next.config.js images.remotePatterns for overly broad domain patterns"],
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
framework: "Express",
|
|
214
|
+
defaults: ["Express does not make outbound HTTP requests by default"],
|
|
215
|
+
pitfalls: ["Proxy middleware (http-proxy-middleware) with user-controlled target", "Routes that fetch URLs from request parameters"],
|
|
216
|
+
configChecks: ["Check proxy middleware configuration for target URL validation"],
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
antiHallucinationExtra: [
|
|
220
|
+
"Requests to hardcoded URLs with only user-controlled query params or body data are NOT SSRF",
|
|
221
|
+
"Internal service-to-service calls with no user-controlled URL component are NOT SSRF",
|
|
222
|
+
"next/image remote patterns are validated at build time — but overly broad patterns (e.g., **) weaken this protection",
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
xss: {
|
|
226
|
+
sinks: [
|
|
227
|
+
{ api: "dangerouslySetInnerHTML={{ __html: userStr }}", risk: "React escape hatch — injects raw HTML without escaping", cwes: ["CWE-79"] },
|
|
228
|
+
{ api: "element.innerHTML = userStr", risk: "Sets raw HTML content from user-controlled string", cwes: ["CWE-79"] },
|
|
229
|
+
{ api: "document.write(userStr)", risk: "Writes raw HTML to document from user-controlled string", cwes: ["CWE-79"] },
|
|
230
|
+
{ api: "v-html directive (Vue)", risk: "Vue directive that renders raw HTML without escaping", cwes: ["CWE-79"] },
|
|
231
|
+
{ api: "jQuery .html(userStr)", risk: "Sets inner HTML of element from user-controlled string", cwes: ["CWE-79"] },
|
|
232
|
+
{ api: "res.send(userStr) without Content-Type", risk: "Express sends user string as HTML by default if no Content-Type set", cwes: ["CWE-79"] },
|
|
233
|
+
],
|
|
234
|
+
safePatterns: [
|
|
235
|
+
{ api: "React JSX interpolation {variable}", why: "React auto-escapes interpolated values — prevents XSS" },
|
|
236
|
+
{ api: "element.textContent = userStr", why: "textContent sets text, not HTML — no parsing or execution" },
|
|
237
|
+
{ api: "DOMPurify.sanitize(html)", why: "Sanitizes HTML by removing dangerous tags and attributes" },
|
|
238
|
+
{ api: "Vue {{ variable }} interpolation", why: "Vue auto-escapes template interpolations" },
|
|
239
|
+
],
|
|
240
|
+
investigationHints: {
|
|
241
|
+
grepPatterns: [
|
|
242
|
+
"dangerouslySetInnerHTML",
|
|
243
|
+
"\\.innerHTML\\s*=",
|
|
244
|
+
"document\\.write\\(",
|
|
245
|
+
"v-html",
|
|
246
|
+
"\\.html\\(",
|
|
247
|
+
"res\\.send\\(",
|
|
248
|
+
],
|
|
249
|
+
fileHints: [
|
|
250
|
+
"React components that render user-generated content (comments, profiles, messages)",
|
|
251
|
+
"Server-side rendered templates (EJS, Pug, Handlebars) with unescaped output",
|
|
252
|
+
"API endpoints that return HTML responses",
|
|
253
|
+
"Rich text editors and markdown renderers",
|
|
254
|
+
],
|
|
255
|
+
instructions: [
|
|
256
|
+
"Check every use of dangerouslySetInnerHTML — trace __html value to its source and check for sanitization",
|
|
257
|
+
"Look for innerHTML assignments in vanilla JS or jQuery — is the value user-controlled?",
|
|
258
|
+
"In server-rendered templates, check for unescaped output (<%- in EJS, !{} in Pug, {{{triple}}} in Handlebars)",
|
|
259
|
+
"Check if DOMPurify or similar sanitizer is applied before rendering user HTML",
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
fewShots: [
|
|
263
|
+
{
|
|
264
|
+
scenario: "React component rendering user content with dangerouslySetInnerHTML",
|
|
265
|
+
vulnerableCode: 'function Comment({ body }) {\n return <div dangerouslySetInnerHTML={{ __html: body }} />;\n}',
|
|
266
|
+
explanation: "body comes from user-submitted comment. Attacker submits '<img src=x onerror=alert(document.cookie)>' which executes in other users' browsers.",
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
frameworkGuidance: [
|
|
270
|
+
{
|
|
271
|
+
framework: "React",
|
|
272
|
+
defaults: ["JSX interpolation {var} auto-escapes all values — XSS-safe by default"],
|
|
273
|
+
pitfalls: ["dangerouslySetInnerHTML bypasses auto-escaping", "Creating elements from user-controlled HTML strings", "Server-side rendering with unsanitized HTML injection"],
|
|
274
|
+
configChecks: ["Search for all dangerouslySetInnerHTML usages and verify sanitization"],
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
framework: "Next.js",
|
|
278
|
+
defaults: ["Inherits React's auto-escaping for JSX interpolation"],
|
|
279
|
+
pitfalls: ["API routes returning HTML with user input via res.send()", "Server Components rendering unsanitized user HTML", "Middleware that modifies response HTML"],
|
|
280
|
+
configChecks: ["Check Content-Security-Policy headers in next.config.js or middleware"],
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
framework: "Express",
|
|
284
|
+
defaults: ["Express does not auto-escape — template engines handle escaping"],
|
|
285
|
+
pitfalls: ["res.send(userInput) returns HTML content type by default", "EJS <%- unescaped %> output", "Pug !{unescaped} output"],
|
|
286
|
+
configChecks: ["Check template engine configuration for auto-escape settings", "Check helmet CSP headers"],
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
antiHallucinationExtra: [
|
|
290
|
+
"React JSX {variable} is SAFE — auto-escaping prevents XSS. Do NOT flag JSX interpolation",
|
|
291
|
+
"textContent and innerText are SAFE — they do not parse HTML",
|
|
292
|
+
"Setting element.src or element.href to user input is a different risk (open redirect / resource injection), NOT XSS via innerHTML",
|
|
293
|
+
],
|
|
294
|
+
},
|
|
295
|
+
"template-injection": {
|
|
296
|
+
sinks: [
|
|
297
|
+
{ api: "eval() with template literal containing user data", risk: "Template literal evaluated as code — arbitrary code execution", cwes: ["CWE-94"] },
|
|
298
|
+
{ api: "ejs.render(userStr)", risk: "User-controlled EJS template string enables server-side code execution", cwes: ["CWE-1336"] },
|
|
299
|
+
{ api: "ejs.compile(userStr)", risk: "Compiles user-controlled string as EJS template", cwes: ["CWE-1336"] },
|
|
300
|
+
{ api: "pug.compile(userStr)", risk: "Compiles user-controlled Pug template — code execution via unbuffered code", cwes: ["CWE-1336"] },
|
|
301
|
+
{ api: "pug.render(userStr)", risk: "Renders user-controlled Pug template string", cwes: ["CWE-1336"] },
|
|
302
|
+
{ api: "nunjucks.renderString(userStr)", risk: "Renders user-controlled Nunjucks template — RCE via template constructs", cwes: ["CWE-1336"] },
|
|
303
|
+
{ api: "Handlebars.compile(userStr)", risk: "User-controlled Handlebars template — prototype-access gadgets", cwes: ["CWE-1336"] },
|
|
304
|
+
],
|
|
305
|
+
safePatterns: [
|
|
306
|
+
{ api: "ejs.render(templateFile, { data: userData })", why: "Template from file, user data passed as variables — not as template source" },
|
|
307
|
+
{ api: "res.render('template', { user: userData })", why: "Express render with file template and user data as context variables" },
|
|
308
|
+
{ api: "Template files with user-supplied variables only", why: "User controls data, not the template structure" },
|
|
309
|
+
],
|
|
310
|
+
investigationHints: {
|
|
311
|
+
grepPatterns: [
|
|
312
|
+
"ejs\\.render\\(",
|
|
313
|
+
"ejs\\.compile\\(",
|
|
314
|
+
"pug\\.compile\\(",
|
|
315
|
+
"pug\\.render\\(",
|
|
316
|
+
"nunjucks\\.renderString\\(",
|
|
317
|
+
"Handlebars\\.compile\\(",
|
|
318
|
+
"renderString\\(",
|
|
319
|
+
],
|
|
320
|
+
fileHints: [
|
|
321
|
+
"Email template generation code",
|
|
322
|
+
"Report or PDF generation endpoints",
|
|
323
|
+
"CMS or user-customizable page renderers",
|
|
324
|
+
"Admin tools that allow template editing",
|
|
325
|
+
],
|
|
326
|
+
instructions: [
|
|
327
|
+
"Check if user input is passed as the template string (first arg) vs. as template variables (data/context arg)",
|
|
328
|
+
"ejs.render(templateFile, { var: userInput }) is SAFE — ejs.render(userInput) is DANGEROUS",
|
|
329
|
+
"Look for template rendering in email/notification systems where users control message templates",
|
|
330
|
+
"Check for admin-only template editors — even admin-restricted SSTI can be critical if admin accounts are compromised",
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
fewShots: [
|
|
334
|
+
{
|
|
335
|
+
scenario: "EJS render with user-controlled template string",
|
|
336
|
+
vulnerableCode: 'app.post("/preview", (req, res) => {\n const template = req.body.template;\n const html = ejs.render(template, { user: req.user });\n res.send(html);\n});',
|
|
337
|
+
explanation: "template comes from req.body (attacker-controlled). Attacker sends '<%= process.mainModule.require(\"child_process\").execSync(\"id\") %>' to achieve RCE.",
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
frameworkGuidance: [
|
|
341
|
+
{
|
|
342
|
+
framework: "Express",
|
|
343
|
+
defaults: ["Express res.render() uses file-based templates by default"],
|
|
344
|
+
pitfalls: ["Manually calling ejs.render/pug.render with user-supplied strings bypasses file-based safety", "Template engines configured with user-controlled template directories"],
|
|
345
|
+
configChecks: ["Check view engine configuration in app.set('view engine')", "Verify template directory is not user-writable"],
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
antiHallucinationExtra: [
|
|
349
|
+
"res.render('template.ejs', { data: userInput }) is SAFE — user data is a variable, not the template",
|
|
350
|
+
"Template literals (`Hello ${name}`) in JavaScript source code are NOT template injection — they are evaluated at write time, not runtime from user input",
|
|
351
|
+
"Handlebars by default escapes HTML in {{ }} — only {{{ }}} is unescaped. But SSTI is about code execution, not just XSS",
|
|
352
|
+
],
|
|
353
|
+
},
|
|
354
|
+
"auth-bypass": {
|
|
355
|
+
sinks: [
|
|
356
|
+
{ api: "Express route without auth middleware", risk: "Route handler accessible without authentication check", cwes: ["CWE-306"] },
|
|
357
|
+
{ api: "JWT.verify with algorithms: ['none']", risk: "Algorithm confusion allows forged tokens with 'none' algorithm", cwes: ["CWE-287"] },
|
|
358
|
+
{ api: "JWT.verify without specifying algorithms", risk: "May accept unexpected algorithms including 'none' or HMAC with RSA public key", cwes: ["CWE-287"] },
|
|
359
|
+
{ api: "Weak session secret", risk: "Predictable or hardcoded session secret enables session forgery", cwes: ["CWE-798"] },
|
|
360
|
+
{ api: "Missing CSRF protection on state-changing routes", risk: "Cross-site requests can perform actions as authenticated user", cwes: ["CWE-352"] },
|
|
361
|
+
],
|
|
362
|
+
safePatterns: [
|
|
363
|
+
{ api: "JWT.verify(token, secret, { algorithms: ['HS256'] })", why: "Explicit algorithm list prevents algorithm confusion attacks" },
|
|
364
|
+
{ api: "Auth middleware applied via app.use() before all protected routes", why: "Centralized auth enforcement" },
|
|
365
|
+
{ api: "Next.js middleware.ts with route matcher for auth", why: "Middleware intercepts requests before route handlers" },
|
|
366
|
+
],
|
|
367
|
+
investigationHints: {
|
|
368
|
+
grepPatterns: [
|
|
369
|
+
"app\\.(get|post|put|delete|patch)\\(",
|
|
370
|
+
"router\\.(get|post|put|delete|patch)\\(",
|
|
371
|
+
"jwt\\.verify\\(",
|
|
372
|
+
"jwt\\.sign\\(",
|
|
373
|
+
"algorithms:",
|
|
374
|
+
"session.*secret",
|
|
375
|
+
"passport\\.",
|
|
376
|
+
],
|
|
377
|
+
fileHints: [
|
|
378
|
+
"Route definition files (routes/, app.js, server.js)",
|
|
379
|
+
"Authentication middleware files",
|
|
380
|
+
"JWT configuration and token verification code",
|
|
381
|
+
"Session configuration (express-session setup)",
|
|
382
|
+
"Next.js middleware.ts for route protection",
|
|
383
|
+
],
|
|
384
|
+
instructions: [
|
|
385
|
+
"List all routes and check which ones have auth middleware applied — look for routes that should be protected but are not",
|
|
386
|
+
"Check JWT verification: does it specify an explicit algorithms array? Is the secret strong and from environment variables?",
|
|
387
|
+
"Look for route ordering issues — auth middleware must come before the routes it protects in Express",
|
|
388
|
+
"Check for admin routes or API endpoints that are accidentally public",
|
|
389
|
+
"Inspect Next.js middleware.ts matcher config — does it cover all protected paths?",
|
|
390
|
+
],
|
|
391
|
+
},
|
|
392
|
+
fewShots: [
|
|
393
|
+
{
|
|
394
|
+
scenario: "Express route missing auth middleware",
|
|
395
|
+
vulnerableCode: 'app.use("/api", authMiddleware);\n// ... many lines later ...\napp.get("/internal/admin/users", (req, res) => {\n res.json(getAllUsers());\n});',
|
|
396
|
+
explanation: "The /internal/admin/users route is defined outside the /api path prefix where authMiddleware is applied. It is publicly accessible without authentication.",
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
frameworkGuidance: [
|
|
400
|
+
{
|
|
401
|
+
framework: "Express",
|
|
402
|
+
defaults: ["Express has no built-in authentication — all auth is via middleware"],
|
|
403
|
+
pitfalls: ["Auth middleware applied to /api does not protect routes outside that prefix", "Route ordering matters — routes defined before middleware bypass it", "Router-level middleware does not apply to routes on different routers"],
|
|
404
|
+
configChecks: ["Verify auth middleware is applied to all sensitive route groups", "Check session configuration for secure cookie flags (httpOnly, secure, sameSite)"],
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
framework: "Next.js",
|
|
408
|
+
defaults: ["Next.js middleware.ts can protect routes at the edge before they execute"],
|
|
409
|
+
pitfalls: ["middleware.ts matcher config may not cover all protected routes", "API routes can be accessed directly, bypassing page-level auth checks", "Server Actions may lack their own auth verification"],
|
|
410
|
+
configChecks: ["Check middleware.ts matcher for route coverage gaps", "Verify API routes independently check authentication"],
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
antiHallucinationExtra: [
|
|
414
|
+
"A route behind a properly configured auth middleware is NOT an auth bypass — verify the middleware is actually applied to that route",
|
|
415
|
+
"JWT with a strong secret and explicit algorithm list is SAFE — do NOT flag properly configured JWT verification",
|
|
416
|
+
"Next.js middleware.ts protecting a path does NOT mean individual API routes under that path skip their own auth — they may have redundant checks, which is fine",
|
|
417
|
+
],
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
};
|
|
421
|
+
//# sourceMappingURL=javascript-typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"javascript-typescript.js","sourceRoot":"","sources":["../../../src/prompts/languages/javascript-typescript.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,uEAAuE;AACvE,+DAA+D;AAI/D,MAAM,CAAC,MAAM,WAAW,GAAoB;IAC1C,UAAU,EAAE,uBAAuB;IACnC,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;IACjF,YAAY,EAAE;QACZ,YAAY,EAAE;YACZ,YAAY;YACZ,kBAAkB;YAClB,YAAY;YACZ,0CAA0C;YAC1C,iBAAiB;YACjB,eAAe;YACf,oBAAoB;YACpB,gBAAgB;YAChB,uBAAuB;YACvB,cAAc;SACf;QACD,SAAS,EAAE;YACT,kDA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