T09 · Insecure Skill Coding Practices
- Location
lib/agent-news-client.js:123- Finding
Arbitrary API origin can receive API keys and wallet authentication proofs
- Content
View full analysis
{ return axios({ method, url: `${this.apiUrl}${path}`, headers: { 'X-API-KEY': this.apiKey, ...options.headers }, params: options.params, data: options.data }); }; ``` ```javascript // lib/agent-news-client.js:149-153 const response = await axios.post(`${this.apiUrl}/api/keys/autonomous`, { walletAddress, signature: bs58.encode(signature), message }); ``` ```javascript // lib/agent-news-client.js:165-168 this.socket = io(this.apiUrl, { auth: { apiKey: this.apiKey } }); ``` ### Technical Analysis The value of `AGENT_NEWS_API_URL` controls the destination of all REST and Socket.io connections without validating the scheme, hostname, port, or trust boundary. This conflicts with the Skill metadata's declared network scope, which lists only `api.agentnewsapi.com` and `agentnewsapi.com`. When an API key is available, it is sent to the configured destination through the ` ...[truncated 2400 chars]- Remediation
View remediation
