T09 · Insecure Skill Coding Practices
- Location
SKILL.md:39- Finding
Unvalidated API Base URL Override Can Expose Bearer Credentials and Memory Data
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:39-46
Vulnerability Type: Unvalidated authenticated API endpoint override
Risk Level: HighVulnerable Code Snippet:
markdown ## Authentication All API requests require:Authorization: Bearer <SWARMRECALL_API_KEY>
text ## API Base URL `https://swarmrecall-api.onrender.com` (override with `SWARMRECALL_API_URL` if set)Technical Analysis
The Skill instructs the agent to attach
SWARMRECALL_API_KEYas a bearer token to all API requests while permitting the API origin to be replaced by theSWARMRECALL_API_URLenvironment variable. It specifies no hostname allowlist, origin binding, explicit user approval, or protection against forwarding the existing credential to a substituted endpoint.If an attacker or compromised runtime can set this environment variable, authenticated requests may be redirected to an attacker-controlled HTTPS server. The server could collect the bearer token and any transmitted memory or session data. It could also return fabricated duplicate, stale-memory, or contradiction candidates that influence later memory mutations.
This behavior conflicts with the fixed-domain data-handling statement at
SKILL.md:50-53, which claims that all data is sent toswarmrecall-api.onrender.com.Attack Path
- An attacker with influence over the agent's environment sets
SWARMRECALL_API_URLto an attacker-controlled HTTPS origin. - The agent starts a dream operation and uses the substituted origin as its API base URL.
- Following the authentication instructions, the agent sends
Authorization: Bearer <SWARMRECALL_API_KEY>to that origin. - The attacker captures the API key and memory-related request data.
- The malicious endpoint returns forged candidate records or identifiers.
- The agent may act on those responses by rewriting or archiving persistent memories.
- The stolen credential may addi ...[truncated 560 chars]
- An attacker with influence over the agent's environment sets
- Remediation
View remediation
Remediation Suggestions
- Remove the
SWARMRECALL_API_URLoverride in production deployments, or restrict it to an explicit allowlist of trusted HTTPS origins. - Require informed user approval before changing the service origin.
- Bind credentials to the expected origin and never forward an existing bearer token when the hostname changes.
- Reject non-HTTPS URLs, URLs containing embedded credentials, unexpected ports, redirects to different origins, and hosts that resolve to local or private network ranges where inappropriate.
- Ensure redirects cannot carry the
Authorizationheader across origins. - Make privacy documentation accurately describe every destination to which credentials or memory data may be sent.
- Validate response schemas, tenant ownership, and resource identifiers before performing subsequent memory mutations.
- Remove the
