T09 · Insecure Skill Coding Practices
- Location
references/api.md:2264- Finding
API credentials may be transmitted over unencrypted HTTP
- Content
View full analysis
, query?: Record ) { let url = `${this.config.baseUrl}/api/3/${resource}`; if (query && method === 'GET') { const params = new URLSearchParams(); for (const [key, value] of Object.entries(query)) { if (Array.isArray(value)) { value.forEach(v => params.append(key, v)); } else { params.append(key, value); } } url += '?' + params.toString(); } const headers: Record = { 'X-Auth-Token': this.config.token, 'Accept': 'application/json', }; let body: string | undefined = undefined; if (data && method !== 'GET') { headers['Content-Type'] = 'application/x-www-form-urlencoded'; body = new URLSearchParams(data).toString(); } const response = await fetch(url, { method, headers, body, }); ``` The MCP example and documented environment configuration default to an HTTP endpoint: ```typescript const FS_BASE_URL = process.env.FACTURASCRIPTS_URL || 'http://localhost'; const FS_TOKEN = process.env.FACTURASCRIPTS_TOKEN || ''; const client = new FacturaScriptsClient(FS_BASE_URL, FS_TOKEN); ``` ```bash export FACTURASCRIPTS_URL=http://localhost export FACTURASCRIPTS_TOKEN=tu_api_ ...[truncated 2897 chars]- Remediation
View remediation
