Summary
YMFE YApi v1.12.0 disables TLS/SSL certificate validation by configuring the Axios HTTPS agent with rejectUnauthorized: false, effectively trusting any server certificate.
This can allow man-in-the-middle attackers on the network path to intercept, read, or modify supposedly secure HTTPS traffic between YApi and remote services.
Affected context
The vulnerability occurs wherever YApi v1.12.0 makes outbound HTTPS requests using Axios with an HTTPS agent that has certificate verification disabled.
It is relevant when YApi communicates with external APIs, webhooks, or internal services over TLS, particularly in environments where network traffic can be intercepted or proxied without strong transport protections.
Exploit preconditions
- Attack surface: Network traffic between the YApi server and its HTTPS endpoints.
- Required access: Ability to position on the network path or control routing/DNS (e.g., on-path attacker, compromised gateway, malicious Wi‑Fi, or internal adversary).
- Trigger point: Any outbound HTTPS request performed by YApi via Axios using an HTTPS agent configured with
rejectUnauthorized: false. - Why exploitation is possible: Disabling certificate verification removes server identity checks, allowing attackers presenting arbitrary or self‑signed certificates to successfully terminate TLS sessions and impersonate legitimate services.
Why this happens
The root cause is the explicit disabling of TLS certificate validation through the HTTPS agent configuration used by Axios.
By setting rejectUnauthorized: false, the client bypasses standard X.509 checks that verify the server's certificate chain and hostname against trusted certificate authorities.
This maps to CWE-295: Improper Certificate Validation, where the application fails to validate or incorrectly validates the authenticity of the remote endpoint, breaking the security guarantees of HTTPS.
Potential impact
- Attackers on the network path may intercept and read sensitive data sent over HTTPS.
- Malicious actors could modify API responses or inject malicious data into requests and responses.
- Credentials, API keys, tokens, and other secrets transmitted over HTTPS can be captured and reused.
- Application behavior could be manipulated by spoofed backend services, leading to data corruption or logic abuse.
- Subsequent lateral movement or privilege escalation within the environment may become possible using stolen data.
General mitigation guidance
Mitigation should focus on restoring strict TLS certificate validation and avoiding trust-by-default configurations.
Common defensive patterns include:
- Ensuring HTTPS clients leave certificate verification enabled and do not set
rejectUnauthorized: falseor equivalent flags. - Using a well-defined trust store (system CAs or an organization-managed CA bundle) and, where needed, pinning to specific CAs or certificates.
- Implementing hostname verification to ensure the certificate's subject matches the intended endpoint.
- Separating development/test overrides (e.g., custom CA for local services) from production code paths, and avoiding debug shortcuts in shipped configurations.
- Applying least-privilege principles to any credentials used over these HTTPS connections so compromise of a connection yields minimal access.
How teams detect issues like this
Effective detection combines code-level inspection with configuration and runtime checks:
- Static analysis rules that flag use of
rejectUnauthorized: false, insecure HTTPS agent options, or equivalent TLS verification bypasses. - Code review guidelines that require justification and documentation for any non-default TLS settings and prohibit disabling certificate checks in production.
- Configuration audits to ensure that environment variables or runtime flags do not silently disable SSL verification.
- Security tests (e.g., dynamic analysis) that attempt to proxy or intercept application traffic with invalid or self-signed certificates to verify that connections fail as expected.
- Integration of automated code scanning tools into CI pipelines to catch insecure TLS configurations before deployment.

