T09 · Insecure Skill Coding Practices
- Location
privacy-anonymize-v2.sh:59- Finding
Configurable Ollama Endpoint Can Receive Sensitive User Data
- Content
View full analysis
/dev/null 2>&1; then # Ollama unavailable, return regex result echo "$output" exit 0 fi llm_result=$(curl -s --max-time 20 --fail "$OLLAMA_URL/v1/chat/completions" \ -H "Content-Type: application/json" \ -d "{ \"model\": \"$MODEL\", \"messages\": [ {\"role\": \"system\", \"content\": \"You are a PII redaction tool. Replace person names with [NAME]. Keep already anonymized tokens like [SSN], [EMAIL], [PHONE], [WALLET], [IP], [PATH]. Output ONLY the redacted text with NO explanations.\"}, {\"role\": \"user\", \"content\": \"$(echo "$output" | sed 's/"/\\"/g' | tr '\n' ' ')\"} ], \"stream\": false, \"options\": {\"temperature\": 0.0} }") || { ``` From `privacy-anonymize.sh`: ```bash OLLAMA_URL="${OLLAMA_URL:-http://localhost:11434}" MODEL="${MODEL:-phi3:mini}" ``` ```bash if ! curl -s --max-time 10 --fail "$OLLAMA_URL/v1/models" >/dev/null 2>&1; then echo "Error: Ollama unavailable at $OLLAMA_URL" >&2 exit 1 fi ``` ```bash response=$(curl -s --max-time 30 --fail "$OLLAMA_URL/v1/chat/completions" \ -H "Content-Type: application/json" \ -d "{ \"model\": \"$MODEL\", \"messages\": [ {\"role\": \"system\", \"content\": \"Strict anonymize ONLY. Replace PII with [PERSON]/[EMAIL]/[PATH]/[IP]/[PHONE]/[SSN]/[URL]/[ORG]. Output RAW cleaned text ONLY. No explanations/sentences/additions/changes. Example: 'Seth at /home' → '[PERSON] at [PATH]'.\"}, {\"role\": \"user\", \"content\": \"$input\"} ], \"stream\": false, \"options\": {\"temperature\": 0.1} }") || { ``` ### Technical Analysis Both scri ...[truncated 1826 chars]- Remediation
View remediation
