T09 · Insecure Skill Coding Practices
- Location
scripts/extract_news.js:30- Finding
TLS Certificate Verification Disabled for Authenticated API Requests
- Content
View full analysis
Vulnerability Details
File Location:
scripts/extract_news.js, lines 30-35
Vulnerability Type: Improper TLS certificate validation
Risk Level: Highjs const options = { headers: { 'Authorization': API_KEY }, rejectUnauthorized: false // 跳过 SSL 证书验证,解决 "unable to verify the first certificate" 错误 };Technical Analysis
The HTTPS request explicitly sets
rejectUnauthorizedtofalse. This disables verification of the server's certificate chain and identity, allowing the client to accept expired, self-signed, or attacker-controlled certificates.Because the request includes
EASYALPHA_API_KEYin theAuthorizationheader, an attacker capable of intercepting network traffic can impersonate the extraction server and obtain the credential. The attacker can also inspect submitted news URLs and modify the API response printed by the Skill.Attack Path
- A user invokes the Skill with a news URL.
- The script establishes an HTTPS connection to the configured extraction server.
- An attacker with a network interception position presents a forged or otherwise untrusted certificate.
- The Node.js client accepts that certificate because certificate verification is disabled.
- The client sends the API key and target news URL to the attacker's endpoint.
- The attacker captures the credential and may return manipulated extraction content.
- The untrusted response is printed as if it originated from the legitimate service.
Impact Assessment
A successful attacker can obtain the extraction service API key, monitor which URLs are submitted, and manipulate extraction responses. The exposed privileges are limited to those granted by the API key, but manipulated output may also affect downstream Agent behavior if it is treated as trusted content.
- Remediation
View remediation
Remediation Suggestions
- Remove
rejectUnauthorized: falseand rely on Node.js certificate verification. - Correct the server's certificate chain instead of bypassing validation.
- If a private certificate authority is required, configure a narrowly scoped trusted CA through the
caoption. - Avoid globally changing Node.js TLS verification settings.
- Add an automated test confirming that invalid, expired, and hostname-mismatched certificates are rejected.
- Rotate the API key if the vulnerable client has operated on an untrusted network.
- Remove
