T09 · Insecure Skill Coding Practices
- Location
scripts/linkding-api.sh:10- Finding
API Token Can Be Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
scripts/linkding-api.sh, lines 10–35
Vulnerability Type: Insufficient transport security validation
Risk Level: Mediumbash 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 anAuthorizationheader 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
- A user, deployment script, or attacker with configuration influence sets
LINKDING_URLor the configuredurlfield to anhttp://endpoint. - The user or Agent invokes any command, such as
bookmarks,create, orprofile. - The script sends `Authorization: Token <API_ ...[truncated 679 chars]
- A user, deployment script, or attacker with configuration influence sets
- Remediation
View remediation
Remediation Suggestions
- Parse and validate
LINKDING_URLbefore making a request. - Require the
httpsscheme 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.
- Parse and validate
