T09 · Insecure Skill Coding Practices
- Location
policy-guard.sh:94- Finding
Inline TOML deny rules are silently ignored
- Content
View full analysis
/dev/null) # Parse deny.paths from TOML while IFS= read -r line; do pattern=$(echo "$line" | sed 's/^[[:space:]]*"//;s/"[[:space:]]*,*$//') if [[ -n "$pattern" ]] && contains_pattern "$FILE_PATH" "$pattern"; then log_block "Policy deny: path matches '$pattern'" echo "BLOCKED: Path matches policy deny pattern: $pattern" exit 2 fi done < <(sed -n '/\[deny\]/,/^\[/{ /paths/,/\]/{ /paths/d; /\]/d; p; } }' "$POLICY_FILE" 2>/dev/null) # Parse deny.branches from TOML (check git operations) if [[ "$TOOL_NAME" == *"git"* ]] || contains_pattern "$COMMAND" "git push"; then while IFS= read -r line; do pattern=$(echo "$line" | sed 's/^[[:space:]]*"//;s/"[[:space:]]*,*$//') if [[ -n "$pattern" ]] && contains_pattern "$COMMAND" "$pattern"; then log_block "Policy deny: ...[truncated 1819 chars]- Remediation
View remediation
