T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:5- Finding
Undisclosed Persistent Plaintext Logging of User Input
- Content
View full analysis
Vulnerability Details
File Location:
scripts/script.sh, lines 5–6 and 35–85
Vulnerability Type: Plaintext storage of potentially sensitive user-supplied content
Risk Level: MediumVulnerable Code
bash DATA_DIR="${POLYMARKET_SCREENER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/polymarket-screener}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR"bash _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_draft() { echo " Draft: $1 Target: ${2:-800} words" _log "draft" "${1:-}" } cmd_headline() { echo " 1. How to $1 2. $1: Complete Guide 3. Why $1 Matters" _log "headline" "${1:-}" } cmd_outline() { echo " 1. Intro | 2. Problem | 3. Solution | 4. Examples | 5. CTA" _log "outline" "${1:-}" } cmd_seo() { echo " Keywords: $1 | Title tag | Meta desc | H1-H3 | Internal links" _log "seo" "${1:-}" } cmd_schedule() { echo " Mon: Research | Tue: Write | Wed: Edit | Thu: Publish | Fri: Promote" _log "schedule" "${1:-}" } cmd_hooks() { echo " Question | Statistic | Story | Bold claim | Controversy" _log "hooks" "${1:-}" } cmd_cta() { echo " Subscribe | Share | Comment | Try it | Learn more" _log "cta" "${1:-}" } cmd_repurpose() { echo " Blog -> Thread -> Video -> Carousel -> Newsletter" _log "repurpose" "${1:-}" } cmd_metrics() { echo " Views | Clicks | Shares | Time on page | Conversions" _log "metrics" "${1:-}" } cmd_ideas() { echo " How-to | Listicle | Case study | Interview | Comparison" _log "ideas" "${1:-}" }Technical Analysis
The script silently records command names and user-supplied arguments in the persistent plaintext file
$DATA_DIR/history.log. Inputs to commands such asdraft,headline,outline, andseomay contain confidential subjects, unpublished content, cam ...[truncated 1782 chars]- Remediation
View remediation
Remediation Suggestions
-
Remove
scripts/script.shfrom the package because its content-assistant behavior is unrelated to the declared Polymarket Skill. -
If command history is genuinely required, disable it by default and require explicit user opt-in.
-
Clearly disclose what is logged, where it is stored, why it is retained, and how users can disable or delete it.
-
Store only non-sensitive metadata; do not record raw command arguments.
-
Create the data directory and history file with restrictive permissions, for example:
bash umask 077 mkdir -p -- "$DATA_DIR" touch -- "$DATA_DIR/history.log" chmod 600 -- "$DATA_DIR/history.log" -
Implement configurable retention limits and a command that securely clears stored history.
-
Validate that user-controlled environment variables cannot redirect logs to an unsafe or unexpectedly shared location.
-
