CVE-2026-77582: Tinyauth User Enumeration Attack By Timing Vulnerability

MODERATE
Advisory Identifier: GHSA-456h-ww26-f758
CWE-208
Published
Advisory Summary

CVE-2026-77582 is a MODERATE user enumeration attack by timing vulnerability (CWE-208: Observable Timing Discrepancy) affecting Tinyauth libraries in the Go ecosystem. The issue involves user enumeration attack by timing oracle. Remediation is available by upgrading affected packages to version 1.0.1-0.20260714134959-c22925c2fba9.

CVE-2026-77582 at a Glance

CVE Identifier CVE-2026-77582
GHSA Identifier GHSA-456h-ww26-f758
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-208: Observable Timing Discrepancy
Affected Product Tinyauth
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-77582

To remediate this vulnerability, upgrade all affected Tinyauth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/tinyauthapp/tinyauth fixed: 1.0.1-0.20260714134959-c22925c2fba9
Upgrade github.com/tinyauthapp/tinyauth to 1.0.1-0.20260714134959-c22925c2fba9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/tinyauthapp/tinyauth

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-77582, inspect your project dependencies for Tinyauth:

inspect dependencies for github.com/tinyauthapp/tinyauth

Analyze the terminal output to locate any version of Tinyauth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.1-0.20260714134959-c22925c2fba9), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-208: Observable Timing Discrepancy, where two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not. In Tinyauth, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary It's possible to enumerate users through a timing oracle. In other words: I can easily check if a username exists or not by observing the timing differences between logins. ### PoC Setup a tinyauth server with a local user. It can be over the network. Try to log in with the local user, using an incorrect password: there is a noticeable delay. You know that the user exists. Now try to log in with a username that does not exist, using an incorrect password: it will complete almost immediately. You know that the user does not exist. ### Expected vs actual behavior Login attempts should take roughly the same amount of time when the user exists vs when the user does not exist. Right now, nonexistent user attempts are way faster, meaning if your login attempt is slow, then the username exists for sure. ### Details Existing usernames will take an extra ~50 milliseconds to respond to login attempts, while non-existing usernames will take only ~50 microseconds (1000x less time) to return an incorrect password response. Even taking network traffic into consideration, it is trivial to check whether a local user exists or not. === Existing user, wrong password === #1: 50.52ms #2: 46.24ms #3: 43.57ms === Nonexistent user === #1: 43.03µs #2: 48.45µs #3: 59.33µs ### Suggested fix This can be solved by checking a dummy password hash when a user is not found before returning a query, this will mimic the exact same delay irrelevant of hardware capabilities. Potential patch: ``` From ca102773e0303f6025480efb26db379e3570a350 Mon Sep 17 00:00:00 2001 From: Disyer <daniel@tohka.us> Date: Tue, 14 Jul 2026 12:35:07 +0300 Subject: [PATCH] fix: prevent user enumeration by means of timing attack --- internal/controller/user_controller.go | 1 + internal/middleware/context_middleware.go | 1 + internal/service/auth_service.go | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/internal/controller/user_controller.go b/internal/controller/user_controller.go index ae6c23b..2ecc996 100644 --- a/internal/controller/user_controller.go +++ b/internal/controller/user_controller.go @@ -90,6 +90,7 @@ func (controller *UserController) loginHandler(c *gin.Context) { if err != nil { if errors.Is(err, service.ErrUserNotFound) { + controller.auth.DummyCheckPassword(req.Password) controller.log.App.Warn().Str("username", req.Username).Msg("User not found during login attempt") controller.auth.RecordLoginAttempt(req.Username, false) controller.log.AuditLoginFailure(req.Username, "unknown", c.ClientIP(), "user not found") diff --git a/internal/middleware/context_middleware.go b/internal/middleware/context_middleware.go index f49c85a..f70c9e7 100644 --- a/internal/middleware/context_middleware.go +++ b/internal/middleware/context_middleware.go @@ -244,6 +244,7 @@ func (m *ContextMiddleware) basicAuth(username string, password string) (*model. search, err := m.auth.SearchUser(username) if err != nil { + m.auth.DummyCheckPassword(password) return nil, nil, fmt.Errorf("error searching for user: %w", err) } diff --git a/internal/service/auth_service.go b/internal/service/auth_service.go index eeb5c8e..9cbc105 100644 --- a/internal/service/auth_service.go +++ b/internal/service/auth_service.go @@ -28,6 +28,10 @@ import ( const MaxOAuthPendingSessions = 256 const OAuthCleanupCount = 16 +// a dummy hash to check when a user is not found, to prevent user enumeration +// hardcoded to prevent having to generate a hash on every startup +const dummyHash = "$2a$10$iFQ6./j2a.UShYQOzWh4vOlnoze5DmHI3tRY3WU4YMj3zwp.t3TnO" + var ( ErrUserNotFound = errors.New("user not found") ) @@ -204,6 +208,12 @@ func (auth *AuthService) CheckUserPassword(search model.UserSearch, password str return errors.New("user authentication failed") } +func (auth *AuthService) DummyCheckPassword(password string) { + // When a user is not found, we still want to perform a password check to prevent + // timing attacks that could reveal whether a user exists or not + bcrypt.CompareHashAndPassword([]byte(dummyHash), []byte(password)) +} + func (auth *AuthService) GetLocalUser(username string) *model.LocalUser { if auth.runtime.LocalUsers == nil { return nil -- 2.55.0 ``` After testing the proposed fix, there is no discernible timing difference: === Existing user, wrong password === #1: 43.23ms #2: 43.26ms #3: 42.57ms === Nonexistent user === #1: 42.45ms #2: 42.11ms #3: 47.71ms

CVE-2026-77582 Affected Tinyauth Versions

1 component(s)
Fixed Versions:
1.0.1-0.20260714134959-c22925c2fba9
Product / Package Ecosystem Affected Versions Fixed Version
github.com/tinyauthapp/tinyauth
Go
< 1.0.1-0.20260714134959-c22925c2fba9
1.0.1-0.20260714134959-c22925c2fba9

References

Frequently Asked Questions

What is CVE-2026-77582?
CVE-2026-77582 is a security vulnerability in Tinyauth involving User enumeration attack by timing oracle under CWE-208: Observable Timing Discrepancy.
Which Tinyauth versions are affected?
Affected versions include releases prior to 1.0.1-0.20260714134959-c22925c2fba9 across affected packages: github.com/tinyauthapp/tinyauth.
What version fixes CVE-2026-77582?
Upgrading to 1.0.1-0.20260714134959-c22925c2fba9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/tinyauthapp/tinyauth affected?
Yes, github.com/tinyauthapp/tinyauth is affected in releases prior to 1.0.1-0.20260714134959-c22925c2fba9. Upgrade your dependency to 1.0.1-0.20260714134959-c22925c2fba9 or later.
What CWE is associated with CVE-2026-77582?
CVE-2026-77582 is classified under CWE-208: Observable Timing Discrepancy (Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not.).
How can I check Go dependencies for CVE-2026-77582?
Run the dependency tree command: 'inspect dependencies for github.com/tinyauthapp/tinyauth'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-456h-ww26-f758",
  "modified" : "2026-09-22T20:37:06Z",
  "published" : "2026-09-22T20:37:06Z",
  "aliases" : [ "CVE-2026-77582" ],
  "summary" : "Tinyauth: User enumeration attack by timing oracle",
  "details" : "### Summary\nIt's possible to enumerate users through a timing oracle. In other words: I can easily check if a username exists or not by observing the timing differences between logins.\n\n### PoC\nSetup a tinyauth server with a local user. It can be over the network.\n\nTry to log in with the local user, using an incorrect password: there is a noticeable delay. You know that the user exists.\n\nNow try to log in with a username that does not exist, using an incorrect password: it will complete almost immediately. You know that the user does not exist.\n\n### Expected vs actual behavior\n\nLogin attempts should take roughly the same amount of time when the user exists vs when the user does not exist.\nRight now, nonexistent user attempts are way faster, meaning if your login attempt is slow, then the username exists for sure.\n\n### Details\n\nExisting usernames will take an extra ~50 milliseconds to respond to login attempts, while non-existing usernames will take only ~50 microseconds (1000x less time) to return an incorrect password response.\n\nEven taking network traffic into consideration, it is trivial to check whether a local user exists or not.\n\n=== Existing user, wrong password ===\n  #1: 50.52ms\n  #2: 46.24ms\n  #3: 43.57ms\n\n=== Nonexistent user ===\n  #1: 43.03µs\n  #2: 48.45µs\n  #3: 59.33µs\n\n### Suggested fix\n\nThis can be solved by checking a dummy password hash when a user is not found before returning a query, this will mimic the exact same delay irrelevant of hardware capabilities.\n\nPotential patch:\n```\nFrom ca102773e0303f6025480efb26db379e3570a350 Mon Sep 17 00:00:00 2001\nFrom: Disyer <daniel@tohka.us>\nDate: Tue, 14 Jul 2026 12:35:07 +0300\nSubject: [PATCH] fix: prevent user enumeration by means of timing attack\n\n---\n internal/controller/user_controller.go    |  1 +\n internal/middleware/context_middleware.go |  1 +\n internal/service/auth_service.go          | 10 ++++++++++\n 3 files changed, 12 insertions(+)\n\ndiff --git a/internal/controller/user_controller.go b/internal/controller/user_controller.go\nindex ae6c23b..2ecc996 100644\n--- a/internal/controller/user_controller.go\n+++ b/internal/controller/user_controller.go\n@@ -90,6 +90,7 @@ func (controller *UserController) loginHandler(c *gin.Context) {\n \n        if err != nil {\n                if errors.Is(err, service.ErrUserNotFound) {\n+                       controller.auth.DummyCheckPassword(req.Password)\n                        controller.log.App.Warn().Str(\"username\", req.Username).Msg(\"User not found during login attempt\")\n                        controller.auth.RecordLoginAttempt(req.Username, false)\n                        controller.log.AuditLoginFailure(req.Username, \"unknown\", c.ClientIP(), \"user not found\")\ndiff --git a/internal/middleware/context_middleware.go b/internal/middleware/context_middleware.go\nindex f49c85a..f70c9e7 100644\n--- a/internal/middleware/context_middleware.go\n+++ b/internal/middleware/context_middleware.go\n@@ -244,6 +244,7 @@ func (m *ContextMiddleware) basicAuth(username string, password string) (*model.\n        search, err := m.auth.SearchUser(username)\n \n        if err != nil {\n+               m.auth.DummyCheckPassword(password)\n                return nil, nil, fmt.Errorf(\"error searching for user: %w\", err)\n        }\n \ndiff --git a/internal/service/auth_service.go b/internal/service/auth_service.go\nindex eeb5c8e..9cbc105 100644\n--- a/internal/service/auth_service.go\n+++ b/internal/service/auth_service.go\n@@ -28,6 +28,10 @@ import (\n const MaxOAuthPendingSessions = 256\n const OAuthCleanupCount = 16\n \n+// a dummy hash to check when a user is not found, to prevent user enumeration\n+// hardcoded to prevent having to generate a hash on every startup\n+const dummyHash = \"$2a$10$iFQ6./j2a.UShYQOzWh4vOlnoze5DmHI3tRY3WU4YMj3zwp.t3TnO\"\n+\n var (\n        ErrUserNotFound = errors.New(\"user not found\")\n )\n@@ -204,6 +208,12 @@ func (auth *AuthService) CheckUserPassword(search model.UserSearch, password str\n        return errors.New(\"user authentication failed\")\n }\n \n+func (auth *AuthService) DummyCheckPassword(password string) {\n+       // When a user is not found, we still want to perform a password check to prevent\n+       // timing attacks that could reveal whether a user exists or not\n+       bcrypt.CompareHashAndPassword([]byte(dummyHash), []byte(password))\n+}\n+\n func (auth *AuthService) GetLocalUser(username string) *model.LocalUser {\n        if auth.runtime.LocalUsers == nil {\n                return nil\n-- \n2.55.0\n```\n\nAfter testing the proposed fix, there is no discernible timing difference:\n\n=== Existing user, wrong password ===\n  #1: 43.23ms\n  #2: 43.26ms\n  #3: 42.57ms\n\n=== Nonexistent user ===\n  #1: 42.45ms\n  #2: 42.11ms\n  #3: 47.71ms",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/tinyauthapp/tinyauth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.1-0.20260714134959-c22925c2fba9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tinyauthapp/tinyauth/security/advisories/GHSA-456h-ww26-f758"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-77582"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tinyauthapp/tinyauth/pull/1004"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tinyauthapp/tinyauth/commit/c22925c2fba981875d0a2b09dd3ee41c0ae4c310"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tinyauthapp/tinyauth"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tinyauthapp/tinyauth/releases/tag/v5.1.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-208" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-22T20:37:06Z",
    "nvd_published_at" : "2026-09-21T17:18:53Z"
  }
}