T09 · Insecure Skill Coding Practices
- Location
src/client.ts:15- Finding
Unrestricted API Base URL Can Expose API Credentials and Transaction Metadata
- Content
View full analysis
{ return this.request("POST", "/v1/score", request); } async submitFeedback(request: FeedbackRequest): Promise { return this.request("POST", "/v1/feedback", request); } async health(): Promise<{ status: string }> { return this.request<{ status: string }>("GET", "/health"); } private async request( method: "GET" | "POST", path: string, body?: unknown, ): Promise { const response = await this.fetchImpl(`${this.baseUrl}${path}`, { method, headers: { "content-type": "application/json", "x-api-key": this.apiKey, }, body: body ? JSON.stringify(body) : undefined, }); ``` The associated normalization function performs no security validation: ```typescript export function normalizeBaseUrl(baseUrl: string): string { return baseUrl.replace(/\/+$/, ""); } ``` ### Technical Analysis The client treats `baseUrl` as trusted after merely removing trailing slashes. It does not parse the value, enforce HTTPS, reject embedded credentials, or restrict the destination to an expected API origin. Every request sends the configured API key in the `x-api-key` header. Scoring requests also contain financial and behavioral metadata, including: - Sender wallet address - Recipient wallet address - Blockchain network - USD-normalized transaction value - Asset and contract metadata - Optional platform, environment, and agent identifiers Although sending this information to a hosted scoring service is necessary for the declared function ...[truncated 1393 chars]- Remediation
View remediation
