# CVE-2026-48154: GoRest: InMemorySecret2FA race condition allows process crash via concurrent map access

> An attacker can crash the GoRest application by triggering a race condition in the 2FA secret storage map, causing a denial of service.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Aug 2026
- **Updated:** 5 Aug 2026
- **Also known as:** GHSA-cpwg-x64r-rgwg, GO-2026-5330

## What is CVE-2026-48154?

CVE-2026-48154 is a medium-severity vulnerability in pilinux gorest, published on 4 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

GoRest is a Golang starter kit built with the Gin framework for prototyping and developing RESTful APIs. In versions prior to 1.12.2 nMemorySecret2FA contains a race condition due to an unsynchronized package-level map used to store 2FA secrets. Multiple HTTP handlers in handler/login.go and handler/twoFA.go read from and write to this map concurrently, and because Go's runtime treats unsynchronized concurrent map access as an unrecoverable fatal error, an attacker can repeatedly trigger this condition to crash the process on demand. This results in high, repeatable availability impact with no confidentiality or integrity consequences. This issue has been fixed in version 1.12.2.

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

## Which versions are affected by CVE-2026-48154?

3 open source packages ship an affected version, including github.com/pilinux/gorest.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/pilinux/gorest` | Go | All versions | 1.12.2 |
| `github.com/pilinux/gorest` | Go | All versions | 1.12.2 |
| `github.com/pilinux/gorest` | Go | All versions | 1.12.2 |

## How do I fix CVE-2026-48154?

Upgrade github.com/pilinux/gorest to 1.12.2 or later.

## Is CVE-2026-48154 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-48154 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-48154 and fix it if it is affected.

What it is: CVE-2026-48154 is a medium-severity vulnerability in pilinux gorest, published on 4 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-48154 exists.

Affected packages and fixed versions:
- github.com/pilinux/gorest (Go): affected all versions; fixed in 1.12.2
- github.com/pilinux/gorest (Go): affected all versions; fixed in 1.12.2
- github.com/pilinux/gorest (Go): affected all versions; fixed in 1.12.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-48154/ (Markdown: https://insights.sbomify.com/CVE-2026-48154/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-48154
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-48154
- OSV: https://osv.dev/vulnerability/CVE-2026-48154

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-48154/
Summaries are generated and may contain mistakes; the official description above is the record.
