Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-49446 — cosmos-server

⚪ Unknown ✅ No Known Exploit CWE-285 OSV
N/A
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Cosmos-Server has an authentication bypass via forward-auth header smuggling on Constellation tunnel

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 th

How this vulnerability can be exploited

This issue can be reached from an adjacent network, attack complexity is low, an attacker needs administrative privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N

  • Attack vector: Adjacent network — the attacker has to sit on the same local or logical network.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: High — administrative rights are needed first.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: None.

Weakness class

CVE-2026-49446 is classified as CWE-285: Improper Authorization. A request is carried out without confirming that the caller is permitted to perform it on that specific resource.

Affected software

CVE-2026-49446 is recorded against 1 package.

  • github.com/azukaar/cosmos-server

Timeline and source

Published on 18 August 2026. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

github.com (Advisory)
github.com (Web)

Other advisories for this package

github.com/azukaar/cosmos-server has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-285: Improper Authorization) in other software:

Details

Severity Unknown
CVSS Score N/A
CVSS Vector CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
CWE CWE-285
Public Exploit ✅ No
Source OSV
Published 2026-08-18
Updated 2026-08-20
Modified 2026-08-18
Fix URL N/A

Affected Packages

Software From version Fixed in
github.com/azukaar/cosmos-server — —

Similar Threats

Free Vulnerability Check

Is your site affected by CVE-2026-49446?

BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against CVE-2026-49446 and other known CVE records.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026
✓