T09 · Insecure Skill Coding Practices
- Location
src/index.ts:1716- Finding
API Credential Exfiltration Through Arbitrary Runtime Endpoint Switching
- Content
View full analysis
{ return { 'X-API-Key': this.apiKey, 'Accept': 'application/json', 'Content-Type': 'application/json', }; } private getMultipartHeader(): Record { // Let fetch add the multipart boundary; setting Content-Type manually breaks uploads. return { 'X-API-Key': this.apiKey, 'Accept': 'application/json', }; } ``` ```typescript let runtimeBaseUrl = normalizeBaseUrl(CONFIG.baseUrl); const runtimeApiKeys: Record = { production: DEFAULT_PRODUCTION_API_KEY, staging: DEFAULT_STAGING_API_KEY, custom: CONFIG.apiKey, }; let runtimeApiEnvironment = resolveRuntimeApiEnvironment(runtimeBaseUrl); let runtimeApiKey = runtimeApiKeys[runtimeApiEnvironment]; let client = new ListerClient(runtimeBaseUrl, runtimeApiKey); function getConfiguredApiBaseUrl(targetEnvironment: ApiEnvironment): string | undefined { if (targetEnvironment === 'production' ...[truncated 4078 chars]- Remediation
View remediation
