Skip to main content

pilinux gorest CVE-2026-48154

| EUVDEUVD-2026-52883 MEDIUM
Race Condition (CWE-362)
2026-06-12 https://github.com/pilinux/gorest GHSA-cpwg-x64r-rgwg
5.9
CVSS 3.1 · Vendor: https://github.com/pilinux/gorest
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send parallel POST /login requests for 2FA-enrolled accounts
  2. Delivery
    Multiple goroutines concurrently execute map write at login.go:139
  3. Exploit
    Go runtime detects concurrent map access
  4. Execution
    Fatal error emitted, process exits immediately
  5. Persist
    Service unavailable until operator restarts
  6. Impact
    Repeat to sustain denial of service

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Concurrency control, locking
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The 2FA feature must be active in the application deployment and at least one user account with 2FA enrolled must exist, as the vulnerable map is only accessed when 2FA-related handler paths are exercised. The attacker must be able to issue two or more concurrent HTTP requests to the login or 2FA endpoints (handler/login.go, handler/twoFA.go) at timing that causes goroutines to collide on the shared map - achievable under normal load without special network position. No authentication or session token is required because the race at handler/login.go:139 occurs during the login flow itself, before credentials are fully validated (PR:N per CVSS). What limits exploitation: if 2FA is disabled or no 2FA-enrolled users exist, the affected code paths are unreachable and the vulnerability is not triggerable; single-threaded or serialized request handling (e.g., GOMAXPROCS=1 with no concurrent clients) would also prevent the race but is not a realistic production configuration.

Impact

The CVSS 3.1 score of 5.9 (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H) is well-calibrated. AC:H reflects the timing requirement: two goroutines must concurrently reach map access code, which is a natural outcome under any moderate load and trivially achievable with parallel curl requests. PR:N is correct because the race can be triggered via the unauthenticated login endpoint (handler/login.go:139 writes to the map during login processing, before authentication completes). The impact is strictly availability: Go's crash mechanism specifically prevents data corruption, so C:N and I:N are accurate. There is no CISA KEV listing and no indication of exploitation in the wild; however, a working proof-of-concept is documented in the advisory. Real-world risk is moderate for any deployment using the 2FA feature under concurrent load, as the crash is repeatable on demand and requires no credentials. The vulnerability is not a priority for deployments where 2FA is disabled, as the affected code paths are not reached.

Exploit ScenarioDerived

An attacker or automated load-test script sends two or more concurrent POST requests to the login endpoint for accounts that have 2FA configured, causing multiple goroutines to simultaneously execute the map write at handler/login.go:139. The Go runtime detects the concurrent write, emits 'fatal error: concurrent map writes', and the entire server process exits with a non-zero status. The attacker can repeat this in a loop to prevent the service from staying up, constituting a reliable denial-of-service that requires no credentials and leaves no partial state. A working proof-of-concept using parallel curl processes is documented in the GHSA advisory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 12, 2026

Concurrent map access without synchronization in pilinux/gorest's InMemorySecret2FA store causes an unrecoverable process crash across all versions through 1.12.1. Nine handler sites in login.go and twoFA.go share a bare Go map with no sync.RWMutex, meaning any two concurrent HTTP requests involving 2FA operations can trigger Go's built-in race detector to throw a fatal, non-catchable error that terminates the entire server process. No public exploit identified at time of analysis, though a proof-of-concept bash script is included in the GHSA advisory; vendor-released patch version 1.12.2 is confirmed.

RemediationAI

Upgrade pilinux/gorest to version 1.12.2 or any later release. The fix is delivered via PR #391 (https://github.com/pilinux/gorest/pull/391), which replaces the bare map[uint64]Secret2FA with a Secret2FAStore struct protected by sync.RWMutex and updates all nine affected call sites in handler/login.go, handler/twoFA.go, and service/common.go to use the thread-safe Get, Set, and Delete methods. If an immediate upgrade is not possible, the sole effective compensating control is to disable the 2FA feature entirely, which prevents any goroutine from reaching the affected code paths; note that this removes a security layer for all users. There is no partial mitigation such as rate limiting that reliably prevents the race, since concurrent requests under normal authenticated traffic can trigger it without adversarial intent. Vendor advisory: https://github.com/pilinux/gorest/security/advisories/GHSA-cpwg-x64r-rgwg.

Affected VersionsENISA

gorest < 1.12.2

Affected Packages

go github.com/pilinux/gorest fix: 1.12.2
euvd gorest fix: 1.12.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Go's built-in map type explicitly prohibits concurrent read/write or write/write access. When the runtime detects such a race, it issues a fatal error (e.g., 'fatal error: concurrent map writes') that cannot be caught by recover() and terminates the process immediately. The affected component is the package-level variable InMemorySecret2FA, declared as map[uint64]Secret2FA in database/model/twoFA.go:43 with no sync.RWMutex, sync.Map, or channel-based serialization. CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization) is the precise root cause: a shared mutable resource is accessed by multiple goroutines - one per incoming HTTP connection - without any mutual exclusion. The affected package is pkg:go/github.com_pilinux_gorest, versions <= 1.12.1. The fix introduced a Secret2FAStore struct wrapping the map behind sync.RWMutex with deep-copy semantics (cloneSecret2FA) to prevent aliasing through shared slice backing arrays.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/pilinux/gorest) PRIMARY 5.9 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 5.9 MEDIUM

Network-reachable via HTTP login endpoint without credentials (AV:N/PR:N); concurrent timing required (AC:H); crash yields full availability loss with no data exposure (A:H/C:N/I:N).

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE MEDIUM

Primary rating from Vendor (https://github.com/pilinux/gorest).

CVSS VectorVendor: https://github.com/pilinux/gorest

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

DescriptionCVE.org

Vulnerability: CWE-362 - Concurrent Map Access Race Condition in InMemorySecret2FA

CWE: CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization)

Affected Component

  • github.com/pilinux/gorest - Go REST API boilerplate
  • InMemorySecret2FA - in-memory 2FA secret store

Vulnerability Locations

FileLineRole
database/model/twoFA.go43Global map[uint64]Secret2FA - bare map, no sync.RWMutex
handler/login.go139Map write during user login
handler/twoFA.go205Map write during 2FA setup
handler/twoFA.go272Map write during 2FA activation
handler/twoFA.go575Map write during 2FA verification
handler/twoFA.go189Map read during 2FA operations
handler/twoFA.go245Map read during 2FA operations
handler/twoFA.go491Map read during 2FA operations
service/common.go79Map delete

Data Flow

Multiple HTTP goroutines (concurrent requests)
    │
    ├── handler/login.go:139 ─► map write ──┐
    ├── handler/twoFA.go:205 ─► map write ──┼── InMemorySecret2FA (bare map)
    ├── handler/twoFA.go:189 ─► map read ───┤      ▲  NO sync.RWMutex
    ├── handler/twoFA.go:245 ─► map read ───┤      │
    ├── handler/twoFA.go:491 ─► map read ───┤      │
    └── service/common.go:79 ─► map delete ─┘      │
                                                   │
            Go runtime detects concurrent map      │
            read+write or write+write              │
                │                                  │
                ▼                                  │
    fatal error: concurrent map read and map write │
    fatal error: concurrent map writes             │
                │                                  │
                ▼                                  │
         Process crash (DoS) ──────────────────────┘

Description

The InMemorySecret2FA in database/model/twoFA.go was defined as a package-level map[uint64]Secret2FA - a bare Go map with no synchronization primitive. Multiple HTTP handlers in handler/login.go and handler/twoFA.go read from and wrote to this map concurrently. Go's runtime detects unsynchronized concurrent map access and throws an unrecoverable fatal error, which crashes the entire process.

This is a CWE-362 race condition: the shared resource (the map) is accessed concurrently without proper synchronization, and the failure mode is a hard process crash (denial of service).

Trigger Conditions

  1. Two users with 2FA enabled logging in simultaneously - concurrent map writes
  2. One user logging in (map write) while another performs 2FA verification (map read)
  3. Any concurrent combination of the 9 affected handler locations

Proof of Concept

bash
# Simulate two concurrent logins with 2FA enabled
for i in 1 2; do
    curl -X POST http://target:8080/api/v1/login         -H "Content-Type: application/json"         -d "{"email":"user${i}@example.com","password":"testpass"}" &
done
wait
# Go runtime output:
# fatal error: concurrent map writes
# goroutine 34 [running]:
# runtime.throw({0x...})
#   runtime/map.go:...

Impact

  • Availability (High): Hard process crash via Go runtime fatal error. No recovery possible - the process exits. An attacker can repeat the concurrent requests to crash the service on demand.
  • Confidentiality (None): The crash itself does not leak data.
  • Integrity (None): No data corruption (Go prevents it by crashing).

Fix (PR #391)

Introduced Secret2FAStore struct with sync.RWMutex protection:

go
// BEFORE: database/model/twoFA.go - bare map, no protection
var InMemorySecret2FA map[uint64]Secret2FA

// AFTER: Wrapped with sync.RWMutex
type Secret2FAStore struct {
    mu   sync.RWMutex
    data map[uint64]Secret2FA
}

func (s *Secret2FAStore) Get(key uint64) (Secret2FA, bool) {
    s.mu.RLock()
    defer s.mu.RUnlock()
    v, ok := s.data[key]
    return cloneSecret2FA(v), ok
}

func (s *Secret2FAStore) Set(key uint64, value Secret2FA) {
    s.mu.Lock()
    defer s.mu.Unlock()
    s.data[key] = cloneSecret2FA(value)
}

func (s *Secret2FAStore) Delete(key uint64) {
    s.mu.Lock()
    defer s.mu.Unlock()
    delete(s.data, key)
}

// cloneSecret2FA returns a deep copy of a Secret2FA.
// This prevents external code from mutating the store's data
// through shared slice backing arrays.
func cloneSecret2FA(v Secret2FA) Secret2FA {
	out := Secret2FA{Image: v.Image}
	if v.PassHash != nil {
		out.PassHash = append([]byte(nil), v.PassHash...)
	}
	if v.KeySalt != nil {
		out.KeySalt = append([]byte(nil), v.KeySalt...)
	}
	if v.Secret != nil {
		out.Secret = append([]byte(nil), v.Secret...)
	}
	return out
}

All 9 handler call sites updated from direct map access to store method calls.

Not Vulnerable (verified during audit)

  • JWT: RSA keys from files, appleboy/gin-jwt middleware - correct
  • Password hashing: Argon2 via pilinux/argon2 - correct
  • SQL queries: GORM parameterized - correct
  • CORS: validates wildcard+credentials combination at config load - correct

Patched Versions

All versions after PR #391 merge.

Resources

  • Fix PR: https://github.com/pilinux/gorest/pull/391

Credit

Reported by @saaa99999999 via manual security audit.

Threat Intelligence Overview

EPSS Score
0.1%
Top 83% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Race conditions occur when multiple concurrent requests exploit the brief time gap between checking a condition and acting upon it (TOCTOU - Time of Check, Time of Use).

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.5 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy