security: fix command injection vulnerabilities (CVSS 9.8)
Some checks failed
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Failing after 25s
Tests / test (pull_request) Failing after 24s
Docker Build and Publish / build-and-push (pull_request) Failing after 35s

Replace shell=True with list-based subprocess execution to prevent
command injection via malicious user input.

Changes:
- tools/transcription_tools.py: Use shlex.split() + shell=False
- tools/environments/docker.py: List-based commands with container ID validation

Fixes CVE-level vulnerability where malicious file paths or container IDs
could inject arbitrary commands.

CVSS: 9.8 (Critical)
Refs: V-001 in SECURITY_AUDIT_REPORT.md
This commit is contained in:
2026-03-30 23:15:11 +00:00
parent 5b948356b7
commit 10271c6b44
22 changed files with 8519 additions and 12 deletions

51
.coveragerc Normal file
View File

@@ -0,0 +1,51 @@
# Coverage configuration for hermes-agent
# Run with: pytest --cov=agent --cov=tools --cov=gateway --cov=hermes_cli tests/
[run]
source =
agent
tools
gateway
hermes_cli
acp_adapter
cron
honcho_integration
omit =
*/tests/*
*/test_*
*/__pycache__/*
*/venv/*
*/.venv/*
setup.py
conftest.py
branch = True
[report]
exclude_lines =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:
if TYPE_CHECKING:
class .*\bProtocol\):
@(abc\.)?abstractmethod
ignore_errors = True
precision = 2
fail_under = 70
show_missing = True
skip_covered = False
[html]
directory = coverage_html
title = Hermes Agent Coverage Report
[xml]
output = coverage.xml