T09 · Insecure Skill Coding Practices
- Location
index.js:62- Finding
Administrator Credentials and Session Cookies May Be Transmitted over Plaintext HTTP
- Content
View full analysis
{ const fullUrl = new URL(endpoint, baseUrl); const protocol = fullUrl.protocol === 'https:' ? https : http; const options = { hostname: fullUrl.hostname, port: fullUrl.port || (fullUrl.protocol === 'https:' ? 443 : 80), path: fullUrl.pathname + fullUrl.search, method: method, headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', } }; if (cookie) { options.headers['Cookie'] = cookie; } if (postData) { options.headers['Content-Length'] = Buffer.byteLength(postData); } const req = protocol.request(options, (res) => { const cookies = res.headers['set-cookie']; let cookieValue = null; if (cookies) { cookieValue = cookies.map(c => c.split(';')[0]).join('; '); } let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { resolve({ statusCode: res.statusCode, data: data, cookie: cookieValue }); }); ...[truncated 3901 chars]- Remediation
View remediation
