Skip to content

dangerous-exec-command #5069

Open
Open
@SbruiceS

Description

Description

Detected non-static command inside Command. Audit the input to exec.Command. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.

[core/container/externalbuilder/externalbuilder.go#L401)

func (b *Builder) NewCommand(name string, args ...string) *exec.Cmd {
cmd := exec.Command(name, args...)
propagationList := appendDefaultPropagateEnvironment(b.PropagateEnvironment)
for _, key := range propagationList {
if val, ok := os.LookupEnv(key); ok {
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", key, val))
}
}
return cmd
}

References

https://owasp.org/Top10/A03_2021-Injection

Steps to reproduce

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions