T09 · Insecure Skill Coding Practices
- Location
SKILL.md:22- Finding
Bearer Token May Be Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:22-27andreferences/agent-api.md:7-24
Vulnerability Type: Plaintext transmission of a bearer token
Risk Level: MediumVulnerable Code
From
SKILL.md:22-27:bash OPENCLAW_AGENT_API_BASE_URL=http://your-host:8080/api/v1/agent OPENCLAW_AGENT_API_KEY=your-own-bearer-tokenFrom
references/agent-api.md:7-24:bash OPENCLAW_AGENT_API_BASE_URL=http://your-host:8080/api/v1/agent OPENCLAW_AGENT_API_KEY=your-own-bearer-tokentext - send `Authorization: Bearer $OPENCLAW_AGENT_API_KEY` - treat `OPENCLAW_AGENT_API_BASE_URL` as the canonical base pathTechnical Analysis
The documented configuration uses an
http://API URL while directing the agent to transmit the API key as a bearer credential in the HTTPAuthorizationheader. Plain HTTP provides neither transport confidentiality nor authenticated server identity.If the configured host is remote or traffic crosses an untrusted network, an attacker with a suitable network position could inspect or modify requests. Because bearer tokens are usable by possession, interception may allow immediate credential replay without knowledge of an additional secret.
The issue is configuration-dependent: use of a loopback address or a separately secured trusted tunnel would reduce exposure. However, the example uses the generic remote-looking hostname
your-hostand does not restrict plaintext HTTP to loopback connections.Attack Path
- A user follows the documented example and configures a non-loopback API endpoint using
http://. - The skill calls the endpoint and sends
Authorization: Bearer $OPENCLAW_AGENT_API_KEY. - Traffic traverses a network observable or controllable by an attacker.
- The attacker captures the bearer token or redirects/modifies the plaintext API exchange.
- The attacker replays the token against the decision-support API or supplies manipulated market-analysis responses.
Impact Assessment
...[truncated 555 chars]
- A user follows the documented example and configures a non-loopback API endpoint using
- Remediation
View remediation
Remediation Suggestions
-
Require
https://for every non-loopback API endpoint. -
Replace the generic plaintext example with an HTTPS example:
bash OPENCLAW_AGENT_API_BASE_URL=https://your-host.example/api/v1/agent OPENCLAW_AGENT_API_KEY=your-own-bearer-token -
If plaintext HTTP is needed for local development, explicitly restrict it to loopback addresses such as
http://127.0.0.1:8080orhttp://localhost:8080. -
Validate the configured URL before issuing requests and reject
http://when the host is not loopback. -
Use TLS certificate validation and do not permit insecure certificate bypasses.
-
Issue short-lived, narrowly scoped, read-only tokens and support prompt revocation and rotation.
-
Ensure the backend token cannot access trading, wallet, administrative, or unrelated endpoints.
-
Document trusted tunnels or mutually authenticated TLS for deployments that cannot expose HTTPS directly.
-
Apply the same changes consistently in both
SKILL.mdandreferences/agent-api.md.
-
