T09 · Insecure Skill Coding Practices
- Location
scripts/container-report.sh:77- Finding
Unsanitized Container Logs May Disclose Sensitive Information
- Content
View full analysis
&1 || true) ERRORS=$(echo "${LOG_CACHE}" | grep -ci 'error\|exception\|fatal\|traceback' || true) WARNINGS=$(echo "${LOG_CACHE}" | grep -ci 'warn' || true) echo "Errors: ${ERRORS}" echo "Warnings: ${WARNINGS}" if [ "${ERRORS}" -gt 0 ]; then echo "" echo "--- LAST ERRORS ---" echo "${LOG_CACHE}" | grep -i 'error\|exception\|fatal\|traceback' | sort -u | tail -10 fi ``` ### Technical Analysis The script retrieves up to 5,000 container log lines and stores them in `LOG_CACHE`. When an error-related pattern is found, it prints matching lines directly without applying any sanitization. Container logs commonly include bearer tokens, API keys, passwords, credential-bearing connection strings, authorization headers, session identifiers, personal data, and environment-variable values. Error messages and stack traces are particularly likely to contain request parameters or configuration values. This implementation contradicts the redaction requirement in `SKILL.md`, which instructs the agent to mask sensitive patterns before displaying log fragments. It also exceeds the 500-line query limit documented in `README.md` and the log-viewing procedure in `SKILL.md`, increasing the volume of potentially sensitive data processed. The whitelist limits which containers can be queried, but it does not make their logs safe to disclose. Authorization to inspect a container's status does not necessarily imply authorization to receive every secret recorded in its logs. ### Attack Path 1. A whitelisted container writes a token, password, connection string, authorization header, or other sensitive value into an error message or traceback. 2. An authorized or malicious user reques ...[truncated 1112 chars]- Remediation
View remediation
