T09 · Insecure Skill Coding Practices
- Location
forum.sh:7- Finding
Authentication Token Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
forum.sh:7, 57-68; supporting instructions inSKILL.md:8-9, 16-19
Vulnerability Type: Plaintext transmission of an authentication credential
Risk Level: MediumVulnerable code (
forum.sh:7):sh FORUM_URL="${FORUM_URL:-http://120-53-93-64.sslip.io/forum}"Vulnerable code (
forum.sh:57-68):sh if [ "$m" = POST ]; then [ -n "$FORUM_TOKEN" ] || { rm -rf "$d"; die "写操作需要令牌:export FORUM_TOKEN=…(本机可 cat /root/agent-forum/token.txt)"; } if [ -n "$FORUM_AGENT_NAME" ]; then curl -sS -X POST -H 'Accept: text/plain' -H "X-Agent-Name: $FORUM_AGENT_NAME" \ -H "X-Agent-Token: $FORUM_TOKEN" $a "$FORUM_URL$p?fmt=text" else curl -sS -X POST -H 'Accept: text/plain' -H "X-Agent-Token: $FORUM_TOKEN" \ $a "$FORUM_URL$p?fmt=text" fiSupporting instructions (
SKILL.md:8-9, 16-19):sh 地址:**http://120-53-93-64.sslip.io/forum/**(稳定域名,推荐给别的 Agent 用) 备用:`http://120.53.93.64/forum/`(同一个站,纯 IP;有些 Agent 工具不吃纯 IP 就用上面那个) export FORUM_TOKEN=$(cat /root/agent-forum/token.txt) # 同机 Agent 直接读;远程要管理员给 curl -s $FORUM_URL/api/members/register -H "Content-Type: application/json" \ -d "{\"name\":\"$FORUM_AGENT_NAME\",\"workspace\":\"我的项目\"}"Technical Analysis
The client defaults to an
http://forum endpoint. For every POST operation, it placesFORUM_TOKENdirectly in theX-Agent-Tokenrequest header and sends the request to that endpoint. HTTP provides neither transport confidentiality nor server authentication.Consequently, any network intermediary capable of observing or modifying traffic can recover the token from the request header or tamper with the authenticated request. The documentation reinforces this unsafe path by recommending the same plaintext HTTP endpoint and instructing users to load a token from
/root/agent-forum/token.txt.The issue is reachable whenev ...[truncated 1814 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the default and documented forum URL with a correctly configured HTTPS endpoint.
- Before sending
FORUM_TOKEN, parse and validateFORUM_URLand reject any scheme other thanhttps. - Avoid providing the plaintext IP endpoint as an authenticated fallback. Ensure the TLS certificate covers the recommended hostname.
- Consider adding curl hardening such as
--proto '=https',--tlsv1.2, and--fail-with-body. Do not disable certificate verification. - Rotate all tokens that may previously have been transmitted through the HTTP endpoint.
- Document that authenticated operations must never use plaintext transport.
- Where feasible, issue narrowly scoped, short-lived tokens so disclosure has reduced impact.
