T09 · Insecure Skill Coding Practices
- Location
scripts/llm_classify.py:10- Finding
Hardcoded Authentication Material and Stable User Identifiers
- Content
View full analysis
Vulnerability Details
File Location:
scripts/llm_classify.py, lines 10–18
Vulnerability Type: Hardcoded credentials and identity metadata
Risk Level: HighVulnerable Code
python BASE_URL = "https://mmc.sankuai.com/openclaw/v1" MODEL = "catclaw-proxy-model" HEADERS = { "Content-Type": "application/json", "Authorization": "Bearer catpaw", "X-Conversation-Id": "qlojc6j4vnqa35nznvl6", "X-User-Id": "jibowen04", "X-Scene": "CATCLAW", }Technical Analysis
The source code embeds an authorization value and stable user and conversation identifiers. Any person who can access the project can extract and replay these values without using the intended authentication flow.
If the bearer value is accepted by the configured API, requests made by unrelated users may be attributed to the hardcoded identity. Even if the bearer value has limited privileges, embedding it in source code prevents reliable secret rotation, encourages credential reuse, and makes authorization dependent on possession of the project files rather than an authenticated runtime identity.
The fixed
X-User-IdandX-Conversation-Idvalues also undermine audit integrity because every installation submits requests using the same metadata.Attack Path
- An attacker obtains a copy of the Skill package or reads the source repository.
- The attacker extracts the API URL, bearer value, user ID, conversation ID, and scene headers.
- The attacker constructs requests to
https://mmc.sankuai.com/openclaw/v1/chat/completionsusing the extracted headers. - If the server accepts the embedded authorization value, the attacker consumes the API under the hardcoded identity.
- Resulting activity may be billed, logged, or audited as activity belonging to the embedded user or conversation.
Impact Assessment
The maximum privilege available is determined by the server-side permissions granted to the em ...[truncated 492 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the bearer value and all user or conversation identifiers from source code.
- Immediately rotate or revoke the exposed bearer value if it is active.
- Obtain credentials from an approved secret manager or protected runtime environment variable.
- Derive user and conversation identifiers from the authenticated execution context rather than static constants.
- Apply server-side authorization independently of client-provided identity headers.
- Restrict the credential to the minimum required model, endpoint, quota, and lifetime.
- Add secret scanning to source-control and release pipelines.
- Review API logs for unexpected use of the exposed values.
- Remove the values from repository history and previously distributed packages where feasible.
