T09 · Insecure Skill Coding Practices
- Location
call-node.js:39- Finding
TLS Certificate Validation Disabled in the Node.js MCP Client
- Content
View full analysis
Vulnerability Details
File Location:
call-node.js, lines 39–48
Vulnerability Type: Improper TLS certificate validation
Risk Level: HighVulnerable Code
javascript const options = { hostname: url.hostname, port: url.port, path: url.pathname, method: 'POST', headers: headers(t), timeout: timeout * 1000, rejectUnauthorized: false, };Technical Analysis
The HTTPS request configuration explicitly sets
rejectUnauthorizedtofalse. This disables verification of the remote server's TLS certificate, including its trust chain and hostname identity.Although the connection remains encrypted, the client cannot establish that it is communicating with the legitimate iFinD MCP server. Any certificate presented by an intercepted or impersonated endpoint will be accepted.
The client includes the configured authentication token in the
Authorizationheader for initialization, notification, tool-listing, and tool-invocation requests. Consequently, a network-positioned attacker can obtain the token by presenting an untrusted certificate. The attacker can also inspect financial queries and return manipulated MCP responses.Attack Path
- A user places a valid iFinD MCP authentication token in
mcp_config.json. - The Node.js client constructs an HTTPS request containing the token in the
Authorizationheader. - An attacker gains a network interception position, compromises a proxy, or redirects the target through DNS or routing manipulation.
- The attacker presents a certificate that would normally fail trust or hostname validation.
- The client accepts the certificate because
rejectUnauthorizedis disabled. - The attacker captures the authentication token and submitted financial-data queries.
- The attacker may replay the token against the service within its granted permissions or return fabricated MCP data to the client.
Impact Assessme
...[truncated 618 chars]
- A user places a valid iFinD MCP authentication token in
- Remediation
View remediation
Remediation Suggestions
-
Remove
rejectUnauthorized: falseand retain the secure Node.js default:javascript const options = { hostname: url.hostname, port: url.port, path: url.pathname, method: 'POST', headers: headers(t), timeout: timeout * 1000, }; -
Do not introduce an environment-controlled option that silently disables certificate validation.
-
If the service relies on a private certificate authority, provide a narrowly scoped CA certificate through the
caoption instead of disabling verification. -
Validate failures using an invalid, expired, self-signed, and hostname-mismatched certificate to ensure that each connection is rejected.
-
Rotate any authentication token that may previously have been transmitted using this client over an untrusted network.
-
Apply least-privilege scopes and expiration to MCP authentication tokens where supported.
-
