T09 · Insecure Skill Coding Practices
- Location
lota_compact_fet.sh:8- Finding
API Credentials Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Locations:
lota_compact_fet.sh:8, 32-38lota_fetch_future_24h.sh:16, 141-146lota_football_matches.sh:8, 49-51
Vulnerability Type: Cleartext transmission of API credentials
Risk Level: HighVulnerable Code
lota_compact_fet.sh:bash BASE_URL="${LOTA_API_BASE_URL:-http://deepdata.lota.tv/predictions/api/v2}"bash local url="${BASE_URL}/compact-fet/?lota_id=${lota_id}" local curl_cmd=("curl" "-s" "--connect-timeout" "30" "--max-time" "60") if [[ -n "${API_KEY}" ]]; then curl_cmd+=("-H" "X-API-Key: ${API_KEY}") fi curl_cmd+=("${url}")lota_fetch_future_24h.sh:bash BASE_URL="${LOTA_API_BASE_URL:-http://deepdata.lota.tv/predictions/api/v2}"bash local curl_cmd=(curl -s --connect-timeout 30 --max-time 60) [[ -n "$API_KEY" ]] && curl_cmd+=(-H "X-API-Key: $API_KEY") local response response=$("${curl_cmd[@]}" "$url")lota_football_matches.sh:bash BASE_URL="${LOTA_API_BASE_URL:-http://deepdata.lota.tv/predictions/api/v2}"bash local curl_cmd=("curl" "-s" "--connect-timeout" "30" "--max-time" "60") [[ -n "${API_KEY}" ]] && curl_cmd+=("-H" "X-API-Key: ${API_KEY}") curl_cmd+=("${url}")Technical Analysis
All three API clients use
http://deepdata.lota.tvas their default endpoint and sendLOTA_API_KEYin theX-API-Keyrequest header. HTTP provides neither transport encryption nor server authentication. Consequently, any party able to observe or manipulate the network path can read the API key, modify requests, or replace API responses.Network access and API authentication are legitimate requirements of the Skill. Transmitting the credential over plaintext HTTP is not necessary for that functionality and violates least-privilege and secure-transport principles.
The optional
LOTA_API_BASE_URLvariable can also redirect authenticated requests t ...[truncated 1382 chars]- Remediation
View remediation
Remediation Suggestions
-
Change the default endpoint to HTTPS:
bash BASE_URL="${LOTA_API_BASE_URL:-https://deepdata.lota.tv/predictions/api/v2}" -
Reject non-HTTPS endpoints before attaching an API key:
bash if [[ -n "$API_KEY" && "$BASE_URL" != https://* ]]; then echo "Error: authenticated API requests require HTTPS" >&2 exit 1 fi -
If plaintext endpoints are required for isolated development, require an explicit unsafe-development flag and never transmit production credentials in that mode.
-
Preserve normal TLS certificate and hostname verification. Do not add
curl --insecure. -
Add robust HTTP failure handling, such as:
bash curl --fail --show-error --silent \ --connect-timeout 30 --max-time 60 \ -H "X-API-Key: $API_KEY" "$url" -
Document that changing
LOTA_API_BASE_URLchanges the recipient of the API key. -
Rotate any API key that may already have been transmitted over an untrusted plaintext connection.
-
