> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# rust-command-shell

> Command::new("sh") or Command::new("bash") spawns a shell and risks command injection.

## What it flags

`Command::new("sh")` or `Command::new("bash")` selects a shell. The rule also recognizes a literal shell path paired with command mode in an immediate `.arg()` or `.args()` call, including Windows Command Prompt and PowerShell. Invoke the target executable directly with `.arg()`.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "rust-command-shell": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.