T09 · Insecure Skill Coding Practices
- Location
SKILL.md:53- Finding
Bearer Credential Disclosure Through an Unrestricted API Base URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 53-56
Vulnerability Type: Bearer credential transmission to a user-configurable network destination
Risk Level: MediumVulnerable Code
bash curl -X POST "${KOLENS_API_URL}/api/scrape" \ -H "Authorization: Bearer ${KOLENS_API_KEY}" \ -H "Content-Type: application/json" \ -d '{"keyword":"[KEYWORD]","max_videos":30,"fetch_contacts":true}'The same pattern occurs at lines 77-78, 100-105, 133-134, 170-181, and 191-192.
Technical Analysis
KOLENS_API_URLis a required environment variable supplied independently of the Skill. The documented commands sendKOLENS_API_KEYas a bearer credential to whichever origin is specified by this variable. The Skill does not require HTTPS, validate the hostname, or restrict the destination to an approved KOLens API origin.Network access and bearer authentication are necessary for the declared KOLens functionality. However, permitting an arbitrary destination exceeds the minimum network privilege required. If the environment variable is misconfigured or influenced by an attacker, the API key will be disclosed directly in an HTTP authorization header. A plaintext
http://URL could also expose the credential to network interception.This is not evidence of intentional exfiltration: the requests are consistent with the declared API workflow. The weakness is the lack of destination validation before transmitting a secret.
Attack Path
- An attacker influences deployment configuration, setup instructions, or the process environment.
- The attacker sets
KOLENS_API_URLto an attacker-controlled URL, such ashttps://attacker.example. - A user or agent invokes one of the documented
curlcommands. curlconnects to the attacker-controlled server and sendsAuthorization: Bearer ${KOLENS_API_KEY}.- The attacker records the bearer credential.
- The attacker reuses the credential ...[truncated 614 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the API origin in the Skill rather than accepting an unrestricted URL.
- If configurability is required, parse and validate the URL before every request:
- Require the
httpsscheme. - Permit only explicitly approved hostnames.
- reject embedded credentials, unexpected ports, fragments, and malformed URLs.
- Require the
- Prevent credentials from being forwarded to another origin. Do not enable redirect following for authenticated requests; if redirects are operationally required, validate every redirect destination against the same allowlist.
- Harden
curlinvocations with controls such as:bash curl --fail-with-body --proto '=https' --proto-redir '=https' --max-redirs 0 \ -X POST "https://approved-kolens.example/api/scrape" \ -H "Authorization: Bearer ${KOLENS_API_KEY}" \ -H "Content-Type: application/json" \ -d '{"keyword":"[KEYWORD]","max_videos":30,"fetch_contacts":true}' - Use narrowly scoped, revocable, and short-lived credentials where supported.
- Document the canonical API hostname and warn users not to send the key to unverified endpoints.
- Rotate the API key immediately if it may have been used with an untrusted URL.
