T09 · Insecure Skill Coding Practices
- Location
scripts/fing_helper.py:40- Finding
Fing API credentials and private network data may be transmitted over plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
scripts/fing_helper.py, lines 40-42, 123-127, and 137
Vulnerability Type: Plaintext transmission of sensitive information
Risk Level: MediumVulnerable Code
python def request_json(base_url: str, endpoint: str, api_key: str) -> dict[str, Any]: params = urllib.parse.urlencode({"auth": api_key}) url = f"{base_url}/1/{endpoint}?{params}" safe_url = f"{base_url}/1/{endpoint}?auth=***"python parser.add_argument("--host", default=os.getenv("FING_API_HOST", "localhost")) parser.add_argument("--port", default=os.getenv("FING_API_PORT", "49090")) parser.add_argument("--scheme", default=os.getenv("FING_API_SCHEME", "http"), choices=["http", "https"]) parser.add_argument("--api-key", default=os.getenv("FING_API_KEY"), help="Fing API key; defaults to FING_API_KEY") parser.add_argument("--raw", action="store_true", help="Print raw API response wrapper") sub = parser.add_subparsers(dest="command", required=True) sub.add_parser("devices", help="List all discovered devices") sub.add_parser("people", help="List Fing Desktop contacts/presence; may be unsupported on Fing Agent/Fingbox") sub.add_parser("summary", help="Compact health/device summary") args = parser.parse_args() if not args.api_key: die("Missing API key. Set FING_API_KEY or pass --api-key.") base_url = f"{args.scheme}://{args.host}:{args.port}" if args.command == "devices": result = request_json(base_url, "devices", args.api_key)Technical Analysis
The helper places the Fing API key in the
authURL query parameter and useshttpas its default transport scheme. Although the documented Fing Local API itself specifies query-string authentication over local HTTP, the helper also permits the host to be changed from loopback to an arbitrary LAN hostname or IP address.When used with a non-loopback host and the default scheme, the API key, request path, a ...[truncated 2538 chars]
- Remediation
View remediation
Remediation Suggestions
- Require HTTPS for non-loopback hosts whenever the Fing deployment supports TLS.
- Detect loopback addresses and refuse plaintext HTTP for other destinations by default.
- If upstream Fing agents only support HTTP, require an explicit option such as
--allow-insecure-httpbefore contacting a non-loopback host and emit a clear warning about credential and inventory exposure. - Recommend a trusted encrypted tunnel, VPN, or local TLS reverse proxy for remote LAN access where native HTTPS is unavailable.
- Prefer an authorization header instead of a query parameter if a future Fing API version supports it. Until then, continue masking the key and document that intermediary and server URL logs may retain it.
- Avoid accepting
--api-keyon the command line where practical because process listings and shell history may expose it. PreferFING_API_KEYfrom a suitably protected environment or secret store. - Validate or constrain configured destinations where operationally possible, and document that arbitrary remote hosts receive the supplied API key.
- Rotate the Fing API key if plaintext traffic may have crossed an untrusted network.
