T09 · Insecure Skill Coding Practices
- Location
scripts/run_daily.sh:73- Finding
Remote Job Listing Data Is Interpolated into Executable Python Source
- Content
View full analysis
/dev/null || echo "0") NONCODING_ADDED=$(python3 -c "import json; d=json.load(open('$SUMMARY_FILE')); print(d.get('noncoding',{}).get('added',0))" 2>/dev/null || echo "0") CODING_TOP=$(python3 -c "import json; d=json.load(open('$SUMMARY_FILE')); print(d.get('coding',{}).get('top','None'))" 2>/dev/null || echo "None") NONCODING_TOP=$(python3 -c "import json; d=json.load(open('$SUMMARY_FILE')); print(d.get('noncoding',{}).get('top','None'))" 2>/dev/null || echo "None") fi ``` ```bash python3 - <&1 | tee -a "$LOG_FILE" || true import sys, json, os sys.path.insert(0, '$SCRIPT_DIR') os.environ['JOBCLAW_DIR'] = '$JOBCLAW_DIR' from notify import send_summary with open('$JOBCLAW_DIR/config.json') as f: config = json.load(f) send_summary( config=config, total_jobs=$TOTAL_JOBS if '$TOTAL_JOBS' != '?' else 0, new_today=$NEW_TODAY, coding_added=$CODING_ADDED, noncoding_added=$NONCODING_ADDED, top_coding='$CODING_TOP', top_noncoding='$NONCODING_TOP', archived=${ARCHIVED_COUNT:-0}, ) PYEOF ``` ### Technical Analysis `CODING_TOP` and `NONCODING_TOP` are read from `search_summary.json`. These values contain company and job-title data obtained from external job listings. The values are subsequently expanded by the shell directly into Python source inside an unquoted heredoc. Shell quoting in the generated Python text does not safely encode these values. A listing containing a single quote, newline, comment character, or other Python syntax can terminate the intended string literal and add attacker-controlled Python expressions or statements. `JOBCLAW_DIR` a ...[truncated 1803 chars]- Remediation
View remediation
