logo

Database

Go Insecure Tls Configuration

Description

Detects insecure TLS configurations in Go code that could allow man-in-the-middle attacks or certificate validation bypasses. The detector specifically looks for tls.Config objects with insecure settings that weaken the TLS security guarantees.

Weakness:

016 - Insecure encryption algorithm - SSL/TLS

Category: Information Collection

Detection Strategy

    Identifies instantiations of tls.Config objects in Go code

    Examines the configuration parameters passed to tls.Config to detect insecure settings

    Reports a vulnerability when tls.Config is created with options that disable certificate validation or allow insecure connections

    Focuses on dangerous configurations like InsecureSkipVerify=true or weak cipher suites

Vulnerable code example

package main

import (
    "crypto/tls"
    "net/http"
)

func insecureTlsConfig() {...

✅ Secure code example

package main

import (
    "crypto/tls"
    "net/http"
)

func secureTlsConfig() {...