CVE-2017-15042: Cleartext transmission of credentials in net/smtp

stdlib Updated 02 Oct 2025

Summary

07/01/2022
Yes i
Unrated
Not published

CVE-2017-15042: Cleartext transmission of credentials in net/smtp. Affects stdlib across 2 version ranges.

>= 1.1.0-0, < 1.8.4 >= 1.9.0-0, < 1.9.1

Fixed in 1.8.4 or 1.9.1, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The net/smtp package in the Go standard library provides functionality for sending emails using the Simple Mail Transfer Protocol (SMTP). It is a widely used package for SMTP client implementations in Go. The package includes support for various authentication schemes, including PLAIN. However, prior to version 1.8.4 and 1.9.1, the PLAIN authentication scheme in net/smtp did not encrypt the transmission of credentials when used on network connections without Transport Layer Security (TLS) protection. This means that passwords were sent in clear text, making them vulnerable to interception by attackers on the network.

Vulnerability Detail

The vulnerability (CVE-2017-15042) arises from the lack of encryption in the PLAIN authentication scheme of net/smtp when used on unsecured network connections. When a client uses PLAIN authentication without TLS, the password is transmitted in clear text, allowing an attacker with access to the network traffic to intercept and obtain the password. This can lead to unauthorized access to the email account and potential misuse of the compromised credentials. The vulnerability affects versions of the Go standard library prior to 1.8.4 and 1.9.1.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 1.1.0-0, < 1.8.4 1.8.4
    go get stdlib@v1.8.4
  • >= 1.9.0-0, < 1.9.1 1.9.1
    go get stdlib@v1.9.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If upgrading to a fixed version of the Go standard library is not immediately feasible, a workaround can be implemented by manually encrypting the network connection using TLS. This can be achieved by using the net/smtp package in conjunction with the crypto/tls package to establish a secure TLS connection before performing the authentication. Here is an example of how to implement this workaround:

package main

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

func main() {
	// Create a TLS configuration
	tlsConfig := &tls.Config{
		InsecureSkipVerify: true, // Skip server certificate verification
	}

	// Dial the SMTP server with a TLS connection
	conn, err := tls.Dial("tcp", "smtp.example.com:587", tlsConfig)
	if err != nil {
		// Handle error
	}

	// Create an SMTP client using the TLS connection
	client, err := smtp.NewClient(conn, "smtp.example.com")
	if err != nil {
		// Handle error
	}

	// Perform authentication and send emails
	// ...
}

Conclusion

The vulnerability (CVE-2017-15042) in the net/smtp package of the Go standard library allows for the cleartext transmission of credentials when using the PLAIN authentication scheme on unsecured network connections. This can lead to unauthorized access to email accounts and potential misuse of compromised credentials. To fix the vulnerability, it is recommended to update to a version of the Go standard library that includes the fix (1.8.4 or 1.9.1 or later). Alternatively, a workaround can be implemented by manually encrypting the network connection using TLS. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

net/smtp is a package in the Go standard library that provides functionality for sending emails using the Simple Mail Transfer Protocol (SMTP). It is commonly used for implementing SMTP clients in Go applications.

The PLAIN authentication scheme is a method for authenticating SMTP clients to servers using a username and password. It involves sending the credentials in plain text over the network, which is vulnerable to interception if the connection is not encrypted.

This vulnerability can be exploited by an attacker who has access to the network traffic between the SMTP client and server. By intercepting the unencrypted transmission of credentials, the attacker can obtain the password and potentially gain unauthorized access to the email account.

Versions of the Go standard library prior to 1.8.4 and 1.9.1 are affected by this vulnerability. It is recommended to update to a fixed version to mitigate the risk.

Yes, a workaround is to manually encrypt the network connection using TLS. By establishing a secure TLS connection before performing the authentication, the transmission of credentials can be protected even on unsecured network connections.

Related vulnerabilities

Recent vulnerabilities recorded for stdlib.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 1.1.0-0, < 1.8.4 1.8.4
    go get stdlib@v1.8.4
  • >= 1.9.0-0, < 1.9.1 1.9.1
    go get stdlib@v1.9.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback