Skip to content

[CRITICAL] TLS Certificate Verification Bypass for Binary Downloads #1

@MacJediWizard

Description

@MacJediWizard

Description

The `SkipSSLVerify` configuration option allows complete bypass of TLS certificate verification. When enabled, it exposes the agent to man-in-the-middle attacks. This is especially dangerous for binary downloads which could allow injection of malicious binaries.

Locations

  • `internal/client/client.go` lines 36-40
  • `cmd/patchmon-agent/commands/serve.go` lines 357-363
  • `cmd/patchmon-agent/commands/version_update.go` lines 315-322, 377-385
if cfg.SkipSSLVerify {
    client.SetTLSClientConfig(&tls.Config{
        InsecureSkipVerify: true,
    })
}

Impact

  • Man-in-the-middle attacks possible when TLS bypass is enabled
  • Attacker could inject malicious binaries during auto-update
  • Complete compromise of agent system

Recommended Fix

  1. Remove or strongly discourage the `SkipSSLVerify` option
  2. If it must remain, NEVER apply it to binary downloads
  3. Implement binary signature verification regardless of TLS setting
  4. Add more prominent warning when this option is used:
if cfg.SkipSSLVerify {
    logger.Error("⚠️ SECURITY WARNING: TLS certificate verification is disabled!")
    logger.Error("⚠️ This exposes the agent to man-in-the-middle attacks")
    logger.Error("⚠️ Do NOT use in production environments")
}
  1. Consider using certificate pinning for update server

Severity

🔴 CRITICAL - Supply chain attack vector

Labels

security, critical

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcriticalCritical prioritysecuritySecurity vulnerability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions