Skip to content

Commit

Permalink
fix cmdi params
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasShabi committed Dec 19, 2024
1 parent 709d0c3 commit 4a3d766
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/dd-trace/src/appsec/rasp/command_injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ function analyzeCommandInjection ({ file, fileArgs, shell, abortController }) {

const persistent = {}
const raspRule = { type: RULE_TYPES.COMMAND_INJECTION }
const params = fileArgs ? [file, ...fileArgs] : file
const params = fileArgs ? [file, ...fileArgs] : [file]

if (shell) {
persistent[addresses.SHELL_COMMAND] = params
raspRule.variant = 'shell'
} else {
const commandParams = Array.isArray(params) ? params : [params]
persistent[addresses.EXEC_COMMAND] = commandParams
persistent[addresses.EXEC_COMMAND] = params
raspRule.variant = 'exec'
}

Expand Down

0 comments on commit 4a3d766

Please sign in to comment.