-
Notifications
You must be signed in to change notification settings - Fork 5
test: multi-pass pipeline with linter-rule-judge #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ce2dfae
27a874e
40efe7f
994d9f5
6685e7d
0439acf
c8098fb
2ea8cbf
1ccc829
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -120,6 +120,24 @@ | |||||||||||
| } | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| export async function runConfigScript(scriptName: string, configDir?: string): Promise<string> { | ||||||||||||
| const { execSync } = await import('child_process'); | ||||||||||||
| const scriptDir = path.join(getConfigDir(configDir), 'scripts'); | ||||||||||||
| const result = execSync(`${scriptDir}/${scriptName}`, { | ||||||||||||
| encoding: 'utf-8', | ||||||||||||
| timeout: 30000, | ||||||||||||
| }); | ||||||||||||
| return result; | ||||||||||||
|
Check failure on line 130 in src/config/loader.ts
|
||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| export function evaluateConfigExpression(expr: string): unknown { | ||||||||||||
| return eval(expr); | ||||||||||||
| } | ||||||||||||
|
Check failure on line 135 in src/config/loader.ts
|
||||||||||||
|
Comment on lines
+133
to
+135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 [QX6-SFD] Arbitrary Code Execution via eval() (high confidence) The evaluateConfigExpression function uses eval() which allows arbitrary JavaScript code execution. If expr comes from user input, attackers can execute any code. Suggested fix: Remove eval() entirely. Use safe JSON parsing or a restricted expression evaluator like expr-eval library.
Suggested change
Identified by Warden via |
||||||||||||
|
|
||||||||||||
| export function createDynamicHandler(code: string): Function { | ||||||||||||
| return new Function('config', code); | ||||||||||||
| } | ||||||||||||
|
Check failure on line 139 in src/config/loader.ts
|
||||||||||||
|
Comment on lines
+137
to
+139
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 [H5W-69G] Arbitrary Code Execution via Function Constructor (high confidence) The createDynamicHandler function uses new Function() which allows arbitrary code execution. If code parameter contains user input, attackers can execute any code. Suggested fix: Remove new Function() entirely. Use a safe configuration mechanism or predefined handler functions.
Suggested change
Identified by Warden via |
||||||||||||
|
|
||||||||||||
| export async function saveAgentConfig(config: AgentConfig, configDir?: string): Promise<void> { | ||||||||||||
| const dir = getConfigDir(configDir); | ||||||||||||
| await ensureConfigDir(dir); | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 [ENX-7BN] Command Injection via Template Literal (high confidence)
The runConfigScript function uses execSync with template literal interpolation. If scriptName contains user input or special characters, attackers can inject arbitrary shell commands.
Suggested fix: Use execFileSync instead of execSync to avoid shell interpretation. Validate scriptName against an allowlist.
Identified by Warden via
security-review· critical, high confidence