Find command execution vectors in Go

Proprietary

Finds Go calls into os/exec (Command, CommandContext). When any part of the command or its arguments is derived from user input, these calls can allow OS command injection. Review each call site to ensure the executable and its arguments are not externally controlled.

org.openrewrite.golang.security.search.FindCommandInjection
mod run . --recipe=org.openrewrite.golang.security.search.FindCommandInjection

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Find method usages os/exec Command(..)
  2. Find method usages os/exec CommandContext(..)