T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/linkding-api.sh:10
- Finding
- API Token Can Be Transmitted over Plaintext HTTP## Vulnerability Details **File Location**: `scripts/linkding-api.sh`, lines 10–35 **Vulnerability Type**: Insufficient transport security validation **Risk Level**: Medium ```bash if [[ -f "$CONFIG_FILE" ]]; then LINKDING_URL=$(jq -r '.url // empty' "$CONFIG_FILE") LINKDING_API_KEY=$(jq -r '.apiKey // empty' "$CONFIG_FILE") fi LINKDING_URL="${LINKDING_URL:-}" LINKDING_API_KEY="${LINKDING_API_KEY:-}" if [[ -z "$LINKDING_URL" || -z "$LINKDING_API_KEY" ]]; then echo "Error: LINKDING_URL and LINKDING_API_KEY must be set (via env or $CONFIG_FILE)" >&2 exit 1 fi # Remove trailing slash LINKDING_URL="${LINKDING_URL%/}" api_call() { local method="$1" local endpoint="$2" shift 2 curl -sS -X "$method" \ -H "Authorization: Token $LINKDING_API_KEY" \ -H "Content-Type: application/json" \ "$@" \ "${LINKDING_URL}${endpoint}" } ``` ### Technical Analysis The server URL is taken directly from the configuration file or environment without validating its scheme. Although the documentation examples use HTTPS, the implementation accepts an `http://` URL and sends the API token in an `Authorization` header to that endpoint. When HTTP is used, neither the token nor the request and response data receive transport-layer confidentiality or integrity protection. Linkding data may include private URLs, descriptions, notes, tags, and account profile information. The configurable endpoint is legitimate because Linkding is self-hosted, but accepting plaintext remote endpoints by default is not necessary for the Skill's declared functionality. ### Attack Path 1. A user, deployment script, or attacker with configuration influence sets `LINKDING_URL` or the configured `url` field to an `http://` endpoint. 2. The user or Agent invokes any command, such as `bookmarks`, `create`, or `profile`. 3. The script sends `Authorization: Token <API_ ...[truncated 679 chars]
- Remediation
- ## Remediation Suggestions - Parse and validate `LINKDING_URL` before making a request. - Require the `https` scheme by default and reject unsupported schemes. - If HTTP support is needed for local development, require an explicit opt-in and restrict it to loopback addresses such as `127.0.0.1`, `::1`, or a clearly documented trusted environment. - Do not silently downgrade HTTPS or disable certificate validation. - Document that production and remote Linkding instances must use HTTPS with a valid certificate. - Consider validating that the URL contains no embedded credentials, fragments, or unexpected control characters.
