Every CVE Search/ Get API key

CVE-2023-32691

ginuerzh/gost vulnerable to Timing Attack

5.9 Medium

gost (GO Simple Tunnel) is a simple tunnel written in golang. Sensitive secrets such as passwords, token and API keys should be compared only using a constant-time comparison function. Untrusted input, sourced from a HTTP header, is compared directly with a secret. Since this comparison is not secure, an attacker can mount a side-channel timing attack to guess the password. As a workaround, this can be easily fixed using a constant time comparing function such as crypto/subtle's ConstantTimeCompare.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
Low
Availability
None

Exploit likelihood

0.57%Up 0.5 points since May 30, 2023
90%50%10%1%

What each source reports

CVE List Score used 5.9

ginuerzh/gost vulnerable to Timing Attack

gost (GO Simple Tunnel) is a simple tunnel written in golang. Sensitive secrets such as passwords, token and API keys should be compared only using a constant-time comparison function. Untrusted input, sourced from a HTTP header, is compared directly with a secret. Since this comparison is not secure, an attacker can mount a side-channel timing attack to guess the password. As a workaround, this can be easily fixed using a constant time comparing function such as crypto/subtle's ConstantTimeCompare.

Record
CVE-2023-32691
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N
Weakness
CWE-203
Updated
2026-11-02
EUVDEUVD-2023-1611 5.9

gost (GO Simple Tunnel) is a simple tunnel written in golang. Sensitive secrets such as passwords, token and API keys should be compared only using a constant-time comparison function. Untrusted input, sourced from a HTTP header, is compared directly with a secret. Since this comparison is not secure, an attacker can mount a side-channel timing attack to guess the password. As a workaround, this can be easily fixed using a constant time comparing function such as crypto/subtle's ConstantTimeCompare.

Record
EUVD-2023-1611
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N
Updated
2026-11-03
GitHub AdvisoriesGHSA-qjrq-hm79-49ww 5.9

ginuerzh/gost vulnerable to Timing Attack

Timing attacks occur when an attacker can guess a secret by observing a difference in processing time for valid and invalid inputs. Sensitive secrets such as passwords, token and API keys should be compared only using a constant-time comparision function. More information on this attack type can be found in this blog post.

Root Cause Analysis

In this case, the vulnerability occurs due to the following code.

https://github.com/ginuerzh/gost/blob/1c62376e0880e4094bd3731e06bd4f7842638f6a/auth.go#L46-L46

Here, a untrusted input, sourced from a HTTP header, is compared directly with a secret. Since, this comparision is not secure, an attacker can mount a side-channel timing attack to guess the password.

Remediation

This can be easily fixed using a constant time comparing function such as crypto/subtle's ConstantTimeCompare. An example fix can be found in https://github.com/runatlantis/atlantis/commit/48870911974adddaa4c99c8089e79b7d787fa820 Alternatively, one can apply the patch below

From d18cff85e1a565f688f717fd8f2cacea62ff9dbf Mon Sep 17 00:00:00 2001
From: Porcupiney Hairs <[email protected]>
Date: Sun, 7 May 2023 01:03:33 +0530
Subject: [PATCH] Fix : Timing attack

---
 auth.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/auth.go b/auth.go
index 1be96e9..be13f23 100644
--- a/auth.go
+++ b/auth.go
@@ -2,6 +2,7 @@ package gost
 
 import (
 	"bufio"
+	"crypto/subtle"
 	"io"
 	"strings"
 	"sync"
@@ -43,7 +44,8 @@ func (au *LocalAuthenticator) Authenticate(user, password string) bool {
 	}
 
 	v, ok := au.kvs[user]
-	return ok && (v == "" || password == v)
+	passOk := subtle.ConstantTimeCompare([]byte(password), []byte(v)) == 0
+	return ok && (v == "" || passOk)
 }
 
 // Add adds a key-value pair to the Authenticator.
-- 
2.25.1

Record
GHSA-qjrq-hm79-49ww
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N
Weakness
CWE-203
Updated
2026-11-02
NVD 5.9

gost (GO Simple Tunnel) is a simple tunnel written in golang. Sensitive secrets such as passwords, token and API keys should be compared only using a constant-time comparison function. Untrusted input, sourced from a HTTP header, is compared directly with a secret. Since this comparison is not secure, an attacker can mount a side-channel timing attack to guess the password. As a workaround, this can be easily fixed using a constant time comparing function such as crypto/subtle's ConstantTimeCompare.

Record
CVE-2023-32691
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness
CWE-203
Updated
2026-11-02
OSV 5.9

ginuerzh/gost vulnerable to Timing Attack

gost (GO Simple Tunnel) is a simple tunnel written in golang. Sensitive secrets such as passwords, token and API keys should be compared only using a constant-time comparison function. Untrusted input, sourced from a HTTP header, is compared directly with a secret. Since this comparison is not secure, an attacker can mount a side-channel timing attack to guess the password. As a workaround, this can be easily fixed using a constant time comparing function such as crypto/subtle's ConstantTimeCompare.

Record
CVE-2023-32691
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N
Weakness
CWE-203
Updated
2026-11-02
OSVGHSA-qjrq-hm79-49ww 5.9

ginuerzh/gost vulnerable to Timing Attack

Timing attacks occur when an attacker can guess a secret by observing a difference in processing time for valid and invalid inputs. Sensitive secrets such as passwords, token and API keys should be compared only using a constant-time comparision function. More information on this attack type can be found in this blog post.

Root Cause Analysis

In this case, the vulnerability occurs due to the following code.

https://github.com/ginuerzh/gost/blob/1c62376e0880e4094bd3731e06bd4f7842638f6a/auth.go#L46-L46

Here, a untrusted input, sourced from a HTTP header, is compared directly with a secret. Since, this comparision is not secure, an attacker can mount a side-channel timing attack to guess the password.

Remediation

This can be easily fixed using a constant time comparing function such as crypto/subtle's ConstantTimeCompare. An example fix can be found in https://github.com/runatlantis/atlantis/commit/48870911974adddaa4c99c8089e79b7d787fa820 Alternatively, one can apply the patch below

From d18cff85e1a565f688f717fd8f2cacea62ff9dbf Mon Sep 17 00:00:00 2001
From: Porcupiney Hairs <[email protected]>
Date: Sun, 7 May 2023 01:03:33 +0530
Subject: [PATCH] Fix : Timing attack

---
 auth.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/auth.go b/auth.go
index 1be96e9..be13f23 100644
--- a/auth.go
+++ b/auth.go
@@ -2,6 +2,7 @@ package gost
 
 import (
 	"bufio"
+	"crypto/subtle"
 	"io"
 	"strings"
 	"sync"
@@ -43,7 +44,8 @@ func (au *LocalAuthenticator) Authenticate(user, password string) bool {
 	}
 
 	v, ok := au.kvs[user]
-	return ok && (v == "" || password == v)
+	passOk := subtle.ConstantTimeCompare([]byte(password), []byte(v)) == 0
+	return ok && (v == "" || passOk)
 }
 
 // Add adds a key-value pair to the Authenticator.
-- 
2.25.1

Record
GHSA-qjrq-hm79-49ww
CVSS 3.1
5.9 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N
Weakness
CWE-203
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
github.com/ginuerzh/gost
Go
through 2.11.5 None known

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2023-32691 is a medium vulnerability (CVSS 5.9) in Ginuerzh Gost, published May 22, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.57%, the 47th percentile. No source names a fixed version.

References

MoveEnter Open