T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/audit.sh:28- Finding
Recursive Memory Scan Exposes Sensitive Content in JSON Reports
- Content
View full analysis
"$PI_SCAN_FILE" for p in "${SCAN_PATHS[@]}"; do if [ -e "$p" ]; then grep -RInE --exclude-dir='.git' --exclude='*.png' --exclude='*.jpg' --exclude='*.jpeg' --exclude='*.gif' --exclude='*.webp' \ "$PI_PATTERNS" "$p" >>"$PI_SCAN_FILE" 2>/dev/null || true fi done ``` ```python "prompt_injection_hits": [l for l in read_file(os.environ["PI_SCAN_FILE"]).splitlines() if l.strip()], ``` ### Technical Analysis The script recursively searches the invoking user's OpenClaw memory and skill directories. Every matching line is copied into a temporary file and then included verbatim in the JSON report. A matching line may contain substantially more information than the detected keyword. For example, a line containing the phrase `system prompt` could also contain private conversation text, credentials, API tokens, internal instructions, filesystem paths, or personal information. The implementation performs no secret detection, redaction, output minimization, file-size restriction, or report-access control. The scan runs with the permissions of the user invoking the script. It does not independently gain elevated operating-system privileges, but it can read all matching files accessible to that account under the selected directories. Because the documented usage redirects stdout to a report file, exposed content can persist after the tem ...[truncated 1616 chars]- Remediation
View remediation
