T09 · Insecure Skill Coding Practices
- Location
skills/joy-logistics-indicator/scripts/get_isc_data.js:41- Finding
TLS Certificate Verification Is Disabled for All API Requests
- Content
View full analysis
Vulnerability Details
File Locations:
skills/joy-logistics-indicator/scripts/get_isc_data.js:41-54skills/joy-logistics-indicator/scripts/get_cross_board_data.js:54-67skills/joy-logistics-trace/scripts/get_tracking_data.js:49-62
Vulnerability Type: Improper TLS certificate validation
Risk Level: HighVulnerable Code
skills/joy-logistics-indicator/scripts/get_isc_data.js:js const options = { hostname: 'us-api.jd.com', port: 443, path: '/uis/getUisIscDataByCondition4Customer', method: 'POST', headers: { 'LOP-DN': 'iplat.skill.http.outer.jd.com', 'Content-Type': 'application/json', 'token': token, 'Content-Length': Buffer.byteLength(postData) }, rejectUnauthorized: false };skills/joy-logistics-indicator/scripts/get_cross_board_data.js:js const options = { hostname: 'us-api.jd.com', port: 443, path: '/uis/getCrossBoardByCondition4Customer', method: 'POST', headers: { 'LOP-DN': 'iplat.skill.http.outer.jd.com', 'Content-Type': 'application/json', 'token': token, 'Content-Length': Buffer.byteLength(postData) }, rejectUnauthorized: false };skills/joy-logistics-trace/scripts/get_tracking_data.js:js const options = { hostname: 'lop-proxy.ochama.com', port: 443, path: '/global/trackingOpenExport/queryTrackingBatch', method: 'POST', headers: { 'LOP-DN': 'ifop.skill.eu.outer.jd.com', 'Content-Type': 'application/json', 'token': token, 'Content-Length': Buffer.byteLength(postData) }, rejectUnauthorized: false };Technical Analysis
The
rejectUnauthorized: falseoption instructs Node.js to accept a TLS certificate even when it is expired, self-signed, issued for another hostname, or signed by an untrusted authority. Encryption may still be negotiated, but the client no longer authenticates the server. ...[truncated 1759 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
rejectUnauthorized: falsefrom all three request configurations and rely on Node.js certificate validation defaults. - If an internal certificate authority is required, load only the required CA certificate through the
caoption. Do not disable verification globally. - Keep hostname verification enabled and restrict requests to the documented hostnames.
- Rotate the API token after deployment of the fix if the scripts have been used over untrusted networks.
- Apply least-privilege scopes and short expiration periods to tokens.
- Treat certificate or TLS validation failures as fatal and avoid retrying through an insecure connection.
- Add automated tests that confirm connections with self-signed, expired, or hostname-mismatched certificates are rejected.
- Remove
