/

CVE-2025-70058

Severity:

HIGH RISK

(7.4)

Improper Certificate Validation in YMFE YApi Axios HTTPS

CVE-2025-70058

Analyzed

Vulnerability type

Category:

Improper Certificate Validation

CWE:

CWE-295

Impact:

Man-in-the-Middle and Traffic Tampering over HTTPS

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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: false or 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.

Sources

SourceLink
gist.github.comgist.github.com/zcxlighthouse/11c53803faf23f607c2787c166e811d4
github.comgithub.com/YMFE
github.comgithub.com/YMFE/yapi

Frequently asked

questions

Yes, if an attacker can position themselves on the network path (for example via compromised infrastructure, malicious Wi‑Fi, or internal network access), they can remotely intercept and tamper with HTTPS connections made by YApi.

The attacker generally needs network-level access that allows them to observe or control traffic between the YApi server and its HTTPS endpoints, such as control over routing, DNS, or a gateway, or physical/logical access to the same network segment.

Re-enable strict TLS certificate validation by removing or disallowing rejectUnauthorized: false and relying on a trusted CA store with proper hostname verification, ensuring these secure defaults are enforced across all outbound HTTPS calls.

Adopt security-focused coding standards that forbid disabling TLS verification, enforce automated checks for insecure TLS settings in CI, segregate development-only TLS exceptions from production code, and regularly review transport security configurations during security assessments and code reviews.

Find out what's already
exploitable in your codebase.