T09 · Insecure Skill Coding Practices
- Location
SKILL.md:101- Finding
Bearer Token Exposure Through an Unvalidated Custom Base URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:101-109, with related configuration insetup.md:28andmemory-template.md:18-20
Vulnerability Type: Unvalidated credential destination
Risk Level: HighVulnerable Code Snippet
From
SKILL.md:markdown Self-hosted instances use custom base URL from memory.md. No other data is sent externally. ## Security & Privacy **Data that leaves your machine:** - Site ID (domain) and query parameters sent to Plausible API - API key sent as Bearer tokenRelated configuration from
setup.md:markdown In `~/plausible/memory.md`: - Site IDs (domains) they track - Base URL (plausible.io or self-hosted) - Preferred default time period - Common query patterns - Goals/events they care aboutRelated template from
memory-template.md:markdown ## Base URL <!-- plausible.io (default) or self-hosted URL --> <!-- Example: https://analytics.example.com -->Technical Analysis
The skill permits an arbitrary self-hosted base URL to be stored in persistent memory and directs authenticated requests to that destination. Those requests include
PLAUSIBLE_API_KEYas a bearer token.The instructions do not require HTTPS, validate or allowlist the destination hostname, prohibit embedded credentials or redirects, block loopback and link-local addresses, or require user confirmation before sending the token to a newly configured host. As a result, an incorrect or attacker-influenced base URL can redirect the API credential to an unintended server.
Although the skill correctly obtains the secret from an environment variable rather than storing it in plaintext, environmental secret storage does not prevent disclosure when the secret is transmitted to an untrusted destination.
Attack Path
- An attacker, misleading user input, or corrupted configuration causes a hostile URL to be written into the
Base URLsection of~/plausible/memory.md. - During a later analytics query, the agen ...[truncated 985 chars]
- An attacker, misleading user input, or corrupted configuration causes a hostile URL to be written into the
- Remediation
View remediation
Remediation Suggestions
- Default exclusively to
https://plausible.iounless the user explicitly enables a self-hosted endpoint. - Require custom base URLs to use HTTPS and reject HTTP, non-web schemes, embedded credentials, malformed hosts, and ambiguous URL forms.
- Resolve and reject loopback, link-local, multicast, private-network, and cloud-metadata destinations unless a narrowly scoped local deployment has been explicitly approved.
- Show the normalized destination hostname and request explicit confirmation before sending credentials to a custom host for the first time or after the host changes.
- Bind each API credential to an approved hostname rather than automatically sending one global environment token to any configured base URL.
- Revalidate the destination after redirects and never forward the authorization header across origins.
- Protect
~/plausible/memory.mdwith restrictive filesystem permissions and treat its endpoint configuration as security-sensitive. - Document credential rotation procedures and advise immediate rotation if an unauthorized endpoint may have received the token.
- Default exclusively to
