T09 · Insecure Skill Coding Practices
- Location
scripts/track_flight.py:34- Finding
API Credential Transmitted Over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
scripts/track_flight.py:34-43
Vulnerability Type: Plaintext transmission of sensitive credentials
Risk Level: HighVulnerable Code
python def fetch_flight_data(flight_number: str, api_key: str) -> dict: """Fetch flight data from AviationStack API""" base_url = "http://api.aviationstack.com/v1/flights" params = { 'access_key': api_key, 'flight_iata': flight_number.upper() } try: response = requests.get(base_url, params=params, timeout=10)The insecure transport limitation is also disclosed in
SKILL.md:104:markdown - Uses AviationStack free tier (no HTTPS on free plan)It is repeated in
references/api-setup.md:41-44:markdown **Free Tier:** - 100 requests/month - Real-time flight data - Historical flights - Airport/airline lookup - HTTP only (no HTTPS)Technical Analysis
The script places the AviationStack API key in the
access_keyquery parameter and submits the request over unencrypted HTTP. The requested flight number is transmitted in the same manner.Because HTTP provides neither transport confidentiality nor server authentication, any party capable of observing or controlling the network path may read the complete request URL. Query strings are also commonly recorded by proxies, gateways, monitoring systems, and server access logs, increasing the number of places where the credential may persist.
An active network attacker can modify the unprotected response as well. Although this does not directly grant local code execution, it can cause the Skill to present forged flight statuses, gates, times, or live-position data.
Calling an external flight-data service is necessary for the declared functionality, and reading the dedicated API-key environment variable is appropriately scoped. Sending that credential through plaintext HTTP, however, ...[truncated 1334 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the endpoint with an HTTPS URL and fail closed if TLS is unavailable:
python base_url = "https://api.aviationstack.com/v1/flights" - Do not support an API plan that requires credentials to be transmitted over plaintext HTTP. Require an HTTPS-capable AviationStack plan or select an alternative flight-data provider that supports TLS.
- Where supported by the provider, move credentials from the query string to an authorization header to reduce exposure through URL logging:
python headers = {"Authorization": f"Bearer {api_key}"} response = requests.get(base_url, headers=headers, params={ "flight_iata": flight_number.upper() }, timeout=10) - Keep TLS certificate verification enabled and do not add
verify=False. - Update
SKILL.mdandreferences/api-setup.mdso they do not direct users toward plaintext credential transmission. - Rotate any API key that has already been used through the HTTP endpoint.
- Avoid including complete request URLs or query parameters in error logs, because they may contain the key.
- Replace the endpoint with an HTTPS URL and fail closed if TLS is unavailable:
