Skip to content

Security: lingeniare/MTProxy

Security

SECURITY.md

Security Policy

Reporting Vulnerabilities

If you discover security issues, please do not use public bug trackers. Send reports directly to: @ingeniare

Security Architecture

This implementation is based on the following principles and technical measures:

Privilege Separation

The MTProxy service runs under a dedicated system account mtproxy with no login shell and no home directory. This minimizes risk in case of service compromise.

Credential Isolation

Operational secrets are stored per-user in /etc/mtproxy/secrets.d/*.secret with 0600 permissions and owner root:root. A wrapper /etc/mtproxy/run.sh injects secrets at runtime, so they are not exposed in the systemd unit or via systemctl cat. Command-line arguments can still be visible through procfs on multi-user systems; use hidepid=2 for /proc where appropriate. Legacy /etc/mtproxy/secret is kept for compatibility. For --engine telemt, generated /etc/telemt/telemt.toml is root:telemt 0640 because the engine must be able to reload user configuration after dropping privileges.

Protocol Obfuscation (Fake TLS)

To counter Deep Packet Inspection (DPI), Fake TLS transport is used. The default upstream engine supports baseline anti-replay and fallback to the real --domain target. Version 1.4.0 additionally supports a multi-domain pool and an opt-in telemt engine with TLS fronting/TCP splitting, TLS emulation, shape hardening, and real backend masking. The strongest deployment mode is --mode own-domain: a real HTTPS website, valid certificate, and DNS/IP/SNI consistency.

Automated Protection (Rate-Limiting)

The installer configures IPv4 and, when enabled, IPv6 hashlimit rules. The default normal profile is 30/min with burst 30; strict remains available through --rate-profile strict or runtime mtproxy-lockdown.sh on. An optional updating FireHOL abuse-list scanner shield can be enabled with --scanner-shield.

Configuration Integrity Control

The automatic Telegram config update process includes a validation step. Downloaded resources are checked for minimum size and structural correctness before being applied. On update failure, the system preserves the last stable configuration.

Network Resilience

External IP detection uses a cascade of 8 independent sources. Firewall rule persistence across reboots is ensured via netfilter-persistent integration.

Operational Recommendations

  1. Authentication: Use SSH key-based access and disable password login.
  2. Monitoring: Regularly check service logs via journalctl -u MTProxy for anomalous connection patterns.
  3. Host Protection: Install fail2ban to protect the SSH management interface from brute-force attacks.
  4. Updates: Apply security patches for the base OS in a timely manner.
  5. Domain Selection: In production, consider using custom or specific domains for Fake TLS emulation.
  6. Stats Access: The statistics web interface is accessible only via loopback (localhost). Do not expose this port to external networks.

There aren't any published security advisories