Skip to content

Subprocess input data warning on literal command #373

@GoldsteinE

Description

@GoldsteinE

Describe the bug
Bandit reports when user is trying to call subprocess, even when command is static.

To Reproduce
Create test.py:

import subprocess

def f():
    print(subprocess.check_output(['/usr/bin/ls']))

Call:

$ bandit test.py

Expected behavior
Bandit shouldn't report B603 on line 4, because there is no way untrusted input appear there.

Bandit version

bandit 1.5.0
  python version = 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions