Skip to main content

SKY-G280 · Go-specific rules

Go weak TLS version

High

TLS 1.0 and 1.1 are old versions of the protocol behind HTTPS, deprecated since 2021 because of known weaknesses. SKY-G280 reports a Go tls.Config{...} literal whose MinVersion is VersionTLS10 or VersionTLS11, which lets connections fall back to them.

Languages
Go
Quality gate
counted toward the gate limits (full and diff scans). Counted toward max_security and max_high.
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

An attacker on the network can push a connection down to the weakest version both sides accept. Compliance scans and standards such as PCI DSS also fail a service that still accepts TLS 1.0.

What Skylos flags

payments/client.go · GoReported on line 9
package payments import (	"crypto/tls"	"net/http") func NewClient() *http.Client {	cfg := &tls.Config{		MinVersion: tls.VersionTLS10,	}	return &http.Client{Transport: &http.Transport{TLSClientConfig: cfg}}}

What Skylos leaves alone

payments/client.go · Go
package payments import (	"crypto/tls"	"net/http") func NewClient() *http.Client {	cfg := &tls.Config{		MinVersion: tls.VersionTLS12,		MaxVersion: tls.VersionTLS13,	}	return &http.Client{Transport: &http.Transport{TLSClientConfig: cfg}}}

Why Skylos leaves it alone

The same client pins TLS 1.2 as the minimum. Only a MinVersion of VersionTLS10 or VersionTLS11 is reported.

How Skylos decides

  1. Runs with --danger. The bundled Go engine, skylos-go, parses each .go file with Go's own parser. _test.go files, symbolic links and files under vendor, testdata, node_modules and hidden folders are skipped.
  2. Finds composite literals of Config from the crypto/tls import (tls.Config{...} or &tls.Config{...}).
  3. Reports when the literal sets MinVersion to a selector ending in VersionTLS10 or VersionTLS11. A constant number such as 0x0301, a variable, or a later assignment cfg.MinVersion = ... is not checked.
  4. Reports HIGH on the line where the literal starts. The ID stays SKY-G280 in the output.

How to fix it

Set MinVersion to tls.VersionTLS12 or tls.VersionTLS13. Go has defaulted clients to TLS 1.2 since 1.18, so removing an old setting also works for a client.

payments/client.go · Go · the fix, against the flagged file
package payments import (	"crypto/tls"	"net/http") func NewClient() *http.Client {	cfg := &tls.Config{Removed: 		MinVersion: tls.VersionTLS10,Added: 		MinVersion: tls.VersionTLS12,	}	return &http.Client{Transport: &http.Transport{TLSClientConfig: cfg}}}

When it can be wrong

  • A client that must talk to an old device or partner system that only speaks TLS 1.0 is reported; the risk is real, but it may be accepted.
  • It misses the same setting made outside the literal (cfg.MinVersion = tls.VersionTLS10) or through a variable.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • At the end of the reported line, where the literal starts:

    Go
    cfg := &tls.Config{ // skylos: ignore[SKY-G280] legacy terminal, isolated VLAN
  • [tool.skylos] ignore = ["SKY-G280"] in a pyproject.toml at the project root turns the rule off. A baseline accepts existing findings, but it records the absolute file path and the line, so an entry stops matching when the checkout moves or the line shifts.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.