Skip to content
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

dangerous-exec-command #5069

Open
SbruiceS opened this issue Dec 10, 2024 · 2 comments
Open

dangerous-exec-command #5069

SbruiceS opened this issue Dec 10, 2024 · 2 comments
Labels

Comments

@SbruiceS
Copy link

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

@SbruiceS SbruiceS added the bug label Dec 10, 2024
@SbruiceS
Copy link
Author

also in this - integration/nwo/command.go:28
integration/nwo/network.go:1225

@denyeart
Copy link
Contributor

In practice the only actor that could do this is the peer admin. If the peer admin is malicious you've got bigger problems. That being said, we would welcome pull requests to audit the input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants