Bandit freezes when start it with key -r against directory with __init__.py file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bandit |
Fix Released
|
High
|
Travis McPeak |
Bug Description
Bandit freezes when start it with key -r against directory with __init__.py file
Steps to reproduce:
1. Create dir sec_scan
2. Create 2 files:
- __init__.py - contains one string (comment - see below)
- base.py - see content below
3. Execute bandit -r sec_scan/
Actual result it is freezes on checking __init__.py file
The output of executing:
/tests/sec_scan$ ls
base.py __init__.py
/tests/sec_scan$ cat base.py
try:
from unittest.case import TestCase
except ImportError:
# Runing unit-tests in production environment
from unittest2.case import TestCase
from mock import patch
import logging
import os
import shutil
import subprocess
import sys
import tempfile
logging.
log = logging.
log.setLevel(
class CliExectutionRe
def __init__(self, process_handle, out, err):
self.stdout = out
self.stderr = err
/tests/sec_scan$ cat __init__.py
# Copyright 2013
(fuel-devops-
[bandit] INFO using config: /home/ykotko/
[bandit] INFO running on Python 2.7.6
----FREEZES---
/tests$ bandit -r sec_scan/
[bandit] INFO using config: /home/ykotko/
[bandit] INFO running on Python 2.7.6
Run started:
2016-01-27 15:32:40.661932
Run metrics:
Total lines of code: 19
Total lines skipped (#nosec): 0
Total issues (by severity):
Total issues (by confidence):
Files skipped (0):
Test results:
>> Issue: [blacklist_imports] Consider possible security implications associated with subprocess module.
Severity: Low Confidence: High
Location: sec_scan/base.py:13
12 import shutil
13 import subprocess
14 import sys
-------
Changed in bandit: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Travis McPeak (travis-mcpeak) |
Changed in bandit: | |
status: | Confirmed → In Progress |
I've found the issue, fix coming soon.