You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security: Gateway TLS verification disabled when gateway_app_id == "any" #607
Note: This issue documents a vulnerability that was originally reported privately as the repository security advisory GHSA-qwh8-369j-c47j by @pbeza.
Root Cause
When the gateway_app_id configuration is set to "any", TLS certificate verification is disabled via tls_no_check(true). Additionally, verify_server_attestation(false) is called unconditionally — the CVM never verifies the gateway's RA-TLS attestation during registration.
CVM is configured with gateway_app_id = "any" (or server attestation is never verified regardless)
CVM connects to the gateway to register and sends its WireGuard private key
A MitM attacker intercepts the connection (possible because TLS verification is disabled or server attestation is not checked)
Attacker captures the WireGuard private key
Attacker can now decrypt all WireGuard-tunneled traffic to/from the CVM
Impact
WireGuard private key theft enables complete traffic interception for the CVM. The attacker can read all P2P communication, including MPC protocol messages containing partial signatures and key material.
Suggested Fix
Always verify server attestation: verify_server_attestation(true)
Never disable TLS verification: remove the tls_no_check call or ensure it's always false
If gateway_app_id = "any" is needed for testing, gate it behind a compile-time feature flag
Note: This finding was reported automatically as part of an AI/Claude-driven internal audit by the NEAR One MPC team. It has not been manually verified by a human to confirm whether it constitutes an actual security issue.
Maintainer response (copied from private security advisory GHSA-qwh8-369j-c47j):
Thanks for the report, but this is not a security vulnerability.
1. gateway_app_id = "any" is configured in the KMS contract, not in the CVM
The gateway_app_id value is set in the KMS contract (on-chain configuration), which is publicly auditable. A contract configured with gateway_app_id = "any" is clearly a development/testing deployment, not a production environment. Any user or verifier can inspect the contract configuration before trusting the deployment.
That said, we acknowledge this is easy to overlook. We plan to provide an automated auditing tool that checks KMS contract configurations and flags insecure settings like gateway_app_id = "any", helping users verify they are interacting with a properly configured production deployment.
2. Runtime configuration vs. compile-time feature flag
Gating this behind a compile-time cargo feature is not strictly better. Cargo features are additive — if any crate in the dependency tree enables a dev-mode feature, it gets enabled for the entire build. This can lead to accidental inclusion that is easy to miss in code review. A runtime configuration that is publicly auditable on-chain provides a clear, verifiable boundary.
Disposition: not a production vulnerability. gateway_app_id is KMS contract configuration and is publicly auditable. Production deployments must not use "any". No code fix is planned for this report under the documented production threat model.
Activity
kvinwang commentedon Mar 27, 2026
Maintainer response (copied from private security advisory GHSA-qwh8-369j-c47j):
Thanks for the report, but this is not a security vulnerability.
1.
gateway_app_id = "any"is configured in the KMS contract, not in the CVMThe
gateway_app_idvalue is set in the KMS contract (on-chain configuration), which is publicly auditable. A contract configured withgateway_app_id = "any"is clearly a development/testing deployment, not a production environment. Any user or verifier can inspect the contract configuration before trusting the deployment.That said, we acknowledge this is easy to overlook. We plan to provide an automated auditing tool that checks KMS contract configurations and flags insecure settings like
gateway_app_id = "any", helping users verify they are interacting with a properly configured production deployment.2. Runtime configuration vs. compile-time feature flag
Gating this behind a compile-time cargo feature is not strictly better. Cargo features are additive — if any crate in the dependency tree enables a dev-mode feature, it gets enabled for the entire build. This can lead to accidental inclusion that is easy to miss in code review. A runtime configuration that is publicly auditable on-chain provides a clear, verifiable boundary.
h4x3rotab commentedon Jun 30, 2026
Maintainer triage update: this is recorded in the public security report table: https://github.com/Dstack-TEE/dstack/blob/master/docs/security/public-security-reports.md#public-reports-and-findings
Disposition: not a production vulnerability.
gateway_app_idis KMS contract configuration and is publicly auditable. Production deployments must not use"any". No code fix is planned for this report under the documented production threat model.Closing as not planned.