T09 · Insecure Skill Coding Practices
- Location
references/install.md:44- Finding
Bearer Token Exposure Through Command-Line Configuration
- Content
View full analysis
Vulnerability Details
File Location:
references/install.md, lines 44–55
Vulnerability Type: Bearer token disclosure through command arguments and shell history
Risk Level: MediumVulnerable Code
bash # Replace <MCP_JWT_TOKEN> with the token created in the previous section: openclaw mcp set creator-skill '{ "url": "https://deinai.ai/mcp", "transport": "streamable-http", "headers": { "Authorization": "Bearer <MCP_JWT_TOKEN>" }, "connectionTimeoutMs": 180000, "timeoutMs": 180000 }'Technical Analysis
The installation instructions direct users to substitute a real MCP bearer token directly into a shell command. The token therefore becomes part of the command-line argument passed to
openclaw.Depending on the operating system and shell configuration, the complete command may be retained in shell history and may be visible temporarily through process inspection. Shell quoting protects token characters from expansion but does not prevent the argument from being recorded or inspected.
The documented token lifetimes include
1yearandforeveratreferences/install.md:31–37, which can significantly extend the useful lifetime of a disclosed credential.Attack Path
- A user creates an MCP token and replaces the placeholder with the real token.
- The user executes the documented
openclaw mcp setcommand. - The command, including the bearer token, is retained in shell history or observed through process metadata while it executes.
- A local attacker, another user with sufficient process-inspection access, or a diagnostic collection process obtains the command text.
- The attacker extracts the token and submits authenticated requests to
https://deinai.ai/mcp. - The attacker invokes available MCP operations, including paid influencer searches, until the token is disabled, expires, or available credits are exhausted.
Impact Assessm
...[truncated 557 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not require users to place bearer tokens directly in command-line arguments.
- Add support for reading the token from protected standard input or an interactive secret prompt that disables terminal echo.
- Prefer integration with an operating-system credential manager or OpenClaw-supported secret store.
- If environment-variable configuration is unavoidable, document its residual exposure risks and ensure the token is not persisted in shell startup files or logs.
- Recommend short-lived MCP tokens by default rather than one-year or non-expiring tokens.
- Ensure stored configuration files have owner-only permissions and that logs redact
Authorizationheaders. - Document a rotation procedure: disable the exposed token through the Deinai token-management endpoint, create a replacement, and securely update the OpenClaw configuration.
- Advise users to remove any previously entered token-bearing commands from shell history and relevant diagnostic artifacts.
