CVE-2026-55761: Github.com/portainer/portainer Portainer Has Unauthenticated Restore Endpoint Vulnerability

HIGH
Advisory Identifier: GHSA-x626-fcwx-f5pc
CVSS 5.9
CWE-287
Published
Advisory Summary

CVE-2026-55761 is a HIGH (CVSS 5.9) portainer has unauthenticated restore endpoint vulnerability (CWE-287: Improper Authentication) affecting Github.com/portainer/portainer libraries in the Go ecosystem. The issue involves portainer has unauthenticated restore endpoint that allows admin takeover on uninitialized instances. Remediation is available by upgrading affected packages to version 2.39.4, 2.43.0.

CVE-2026-55761 at a Glance

CVE Identifier CVE-2026-55761
GHSA Identifier GHSA-x626-fcwx-f5pc
Severity HIGH
CVSS v3.1 Base Score 5.9
CWE Classification CWE-287: Improper Authentication
Affected Product Github.com/portainer/portainer
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-55761

To remediate this vulnerability, upgrade all affected Github.com/portainer/portainer 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/portainer/portainer fixed: 2.39.4
Upgrade github.com/portainer/portainer to 2.39.4
github.com/portainer/portainer fixed: 2.43.0
Upgrade github.com/portainer/portainer to 2.43.0
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/portainer/portainer

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-55761, inspect your project dependencies for Github.com/portainer/portainer:

inspect dependencies for github.com/portainer/portainer

Analyze the terminal output to locate any version of Github.com/portainer/portainer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.39.4), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Github.com/portainer/portainer, 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 Portainer supports restoring an instance from a backup archive via the /api/restore endpoint. This endpoint is intentionally unauthenticated to allow restoring before the first admin account is created, and remains accessible for the five-minute initialization window that opens each time Portainer starts. Any unauthenticated attacker with network access to a Portainer instance that has not yet been initialised can exploit this window to replace the Portainer database with a crafted archive containing attacker-controlled credentials and gain full administrative access. The same unauthenticated setup window also exposes the administrator-account-creation endpoint (`/api/users/admin/init`), which an attacker can call to create the first administrator directly; the fix gates both endpoints. The attack requires the instance to be uninitialized, reachable by the attacker, and within the five-minute window. Once that window expires without initialization, Portainer locks its API and requires a restart to re-enable setup — each restart opens a fresh window. No credentials, session tokens, or local access are required. ## Severity **High** The endpoint requires no authentication and no user interaction, but successful exploitation depends on three conditions holding simultaneously: the instance must be uninitialized, reachable from the attacker's network, and within the five-minute setup window that Portainer enforces before locking the instance pending a restart. Once those conditions are met, the attack itself is straightforward — no specialized tooling or elevated privileges are needed. The vulnerable system impact is limited by the precondition: a brand new instance carries no confidential data, no existing users, and no running workloads, so the direct integrity and availability impact is low. The severity is driven entirely by the subsequent-system chain — Portainer CE is typically bound to a Docker socket that grants root-equivalent access to the host, and the compromised admin account inherits credentials and API access for every Docker host, Kubernetes cluster, and edge agent registered in the instance. ## Affected Versions The unauthenticated initialization path has been present since the backup/restore feature was introduced. Fixes are included in the following releases: | Branch | First vulnerable | Fixed in | |--------------|------------------|------------| | 2.39.x (LTS) | 2.39.0 | **2.39.4** | | 2.43.x (STS) | all prior | **2.43.0** | Portainer releases prior to 2.39.0 are end-of-life and will not receive a fix. This includes the 2.33.x LTS line. Users on end-of-life versions should upgrade to a supported branch. ## Workarounds Administrators who cannot immediately upgrade can reduce exposure by: - **Provision the administrator account at deploy time.** Start any network-reachable instance with `--admin-password` or `--admin-password-file`, supplying a pre-set administrator password. The admin account then exists from first boot, so the instance is never in the uninitialised state that the restore and admin-init endpoints depend on — there is no setup window for an attacker to race. This is the most effective workaround for new, internet- or network-facing deployments. Instances on genuinely trusted networks (air-gapped or isolated private LANs) don't require it. - **Restrict network access to Portainer before completing initial setup.** Use firewall rules, VPC security groups, or a reverse proxy to prevent untrusted networks from reaching the Portainer API while the instance is uninitialised. Remove the restriction once an admin account has been created and initial setup is complete. - **Complete initial setup immediately after deployment.** The initialization endpoints stop accepting requests once the instance has an administrator account. Minimising the uninitialised window limits the exploitation opportunity. - **Audit existing deployments for unauthorised admin accounts.** If a deployment may have been accessible before setup was completed, review the admin account list and rotate all credentials. None of these replace the fix. ## Affected Code The vulnerability is in `api/http/handler/backup/handler.go` and `api/http/handler/backup/restore.go`. The handler registers the restore endpoint with `bouncer.PublicAccess`, bypassing all authentication middleware: ```go // api/http/handler/backup/handler.go — NewHandler h.Handle("/restore", bouncer.PublicAccess(httperror.LoggerHandler(h.restore))).Methods(http.MethodPost) ``` The restore handler then checks only whether the instance has been initialised before proceeding: ```go // api/http/handler/backup/restore.go — restore func (h *Handler) restore(w http.ResponseWriter, r *http.Request) *httperror.HandlerError { initialized, err := h.adminMonitor.WasInitialized() if err != nil { return httperror.InternalServerError("Failed to check system initialization", err) } if initialized { return httperror.BadRequest("Cannot restore already initialized instance", errors.New("system already initialized")) } h.adminMonitor.Stop() // Proceeds to restore the archive unconditionally ``` The fix introduces a one-time setup token that gates the public initialization endpoints — both administrator account creation (`/api/users/admin/init`) and restore (`/api/restore`) — while an instance is uninitialised. On startup, when no administrator account exists and no admin password was supplied through configuration, Portainer generates a cryptographically random token and writes it to the server logs. The restore and admin-init handlers reject any request that does not present this token in an `X-Setup-Token` header, returning `403 Forbidden`. Deployments that provision the administrator password at deploy time (`--admin-password` / `--admin-password-file`) require no token; the requirement can be pinned to an operator-chosen value (`--setup-token`) or disabled on trusted networks (`--no-setup-token`). The same change is backported to `release/2.39` for the 2.39.4 release. ## Impact - **Full administrative access to Portainer.** The attacker replaces the database with one containing their own admin credentials and can then authenticate as a full administrator with no legitimate-user involvement. - **Host-level compromise.** Portainer CE typically runs with access to the Docker socket (`/var/run/docker.sock`); an attacker with Portainer admin access can use container creation APIs to mount the host filesystem and execute commands as root. - **Access to all managed environments.** The compromised Portainer admin account has credentials and API access for every Docker host, Kubernetes cluster, and edge agent registered in that instance, including any stored registry credentials, environment variables, and secrets. - **Persistence across credential changes.** Because the attacker controls the database, they can re-insert admin credentials or maintain secondary accounts even if a legitimate user later resets the primary password via the UI. ## Timeline - 2026-05-07: Reported privately by **um3b0shi**. - 2026-06-04: Fix merged to `develop`. - 2026-06-24: 2.43.0 (STS) released with the fix. - 2026-06-25: 2.39.4 (LTS) released with the backported fix. ## Credit - **um3b0shi** — discovered and reported the unauthenticated admin takeover via the `/api/restore` endpoint. Coverage of the companion administrator-account-creation endpoint (`/api/users/admin/init`) was added by the Portainer team as part of the fix.

CVE-2026-55761 Affected Github.com/portainer/portainer Versions

2 component(s)
Fixed Versions:
2.39.42.43.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/portainer/portainer
Go
≥ 2.39.0
< 2.39.4
2.39.4
github.com/portainer/portainer
Go
≥ 2.40.0
< 2.43.0
2.43.0

References

Frequently Asked Questions

What is CVE-2026-55761?
CVE-2026-55761 is a security vulnerability in Github.com/portainer/portainer involving Portainer has Unauthenticated Restore Endpoint that Allows Admin Takeover on Uninitialized Instances under CWE-287: Improper Authentication.
Which Github.com/portainer/portainer versions are affected?
Affected versions include releases prior to 2.39.4, 2.43.0 across affected packages: github.com/portainer/portainer.
What version fixes CVE-2026-55761?
Upgrading to 2.39.4, 2.43.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/portainer/portainer affected?
Yes, github.com/portainer/portainer is affected in releases prior to 2.39.4, 2.43.0. Upgrade your dependency to 2.39.4, 2.43.0 or later.
What is the CVSS score of CVE-2026-55761?
CVE-2026-55761 has a CVSS v3.1 base score of 5.9 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-55761?
CVE-2026-55761 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Go dependencies for CVE-2026-55761?
Run the dependency tree command: 'inspect dependencies for github.com/portainer/portainer'. 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-x626-fcwx-f5pc",
  "modified" : "2026-08-28T20:28:19Z",
  "published" : "2026-08-28T20:28:19Z",
  "aliases" : [ "CVE-2026-55761" ],
  "summary" : "Portainer has Unauthenticated Restore Endpoint that Allows Admin Takeover on Uninitialized Instances",
  "details" : "## Summary\nPortainer supports restoring an instance from a backup archive via the /api/restore endpoint. This endpoint is intentionally unauthenticated to allow restoring before the first admin account is created, and remains accessible for the five-minute initialization window that opens each time Portainer starts. Any unauthenticated attacker with network access to a Portainer instance that has not yet been initialised can exploit this window to replace the Portainer database with a crafted archive containing attacker-controlled credentials and gain full administrative access. The same unauthenticated setup window also exposes the administrator-account-creation endpoint (`/api/users/admin/init`), which an attacker can call to create the first administrator directly; the fix gates both endpoints.\n\nThe attack requires the instance to be uninitialized, reachable by the attacker, and within the five-minute window. Once that window expires without initialization, Portainer locks its API and requires a restart to re-enable setup — each restart opens a fresh window. No credentials, session tokens, or local access are required.\n\n## Severity\n**High**\n\nThe endpoint requires no authentication and no user interaction, but successful exploitation depends on three conditions holding simultaneously: the instance must be uninitialized, reachable from the attacker's network, and within the five-minute setup window that Portainer enforces before locking the instance pending a restart. Once those conditions are met, the attack itself is straightforward — no specialized tooling or elevated privileges are needed. The vulnerable system impact is limited by the precondition: a brand new instance carries no confidential data, no existing users, and no running workloads, so the direct integrity and availability impact is low. The severity is driven entirely by the subsequent-system chain — Portainer CE is typically bound to a Docker socket that grants root-equivalent access to the host, and the compromised admin account inherits credentials and API access for every Docker host, Kubernetes cluster, and edge agent registered in the instance.\n\n## Affected Versions\n\nThe unauthenticated initialization path has been present since the backup/restore feature was introduced.\n\nFixes are included in the following releases:\n\n| Branch       | First vulnerable | Fixed in   |\n|--------------|------------------|------------|\n| 2.39.x (LTS) | 2.39.0           | **2.39.4** |\n| 2.43.x (STS) | all prior        | **2.43.0** |\n\nPortainer releases prior to 2.39.0 are end-of-life and will not receive a fix. This includes the 2.33.x LTS line. Users on end-of-life versions should upgrade to a supported branch.\n\n## Workarounds\nAdministrators who cannot immediately upgrade can reduce exposure by:\n\n- **Provision the administrator account at deploy time.** Start any network-reachable instance with `--admin-password` or `--admin-password-file`, supplying a pre-set administrator password. The admin account then exists from first boot, so the instance is never in the uninitialised state that the restore and admin-init endpoints depend on — there is no setup window for an attacker to race. This is the most effective workaround for new, internet- or network-facing deployments. Instances on genuinely trusted networks (air-gapped or isolated private LANs) don't require it.\n- **Restrict network access to Portainer before completing initial setup.** Use firewall rules, VPC security groups, or a reverse proxy to prevent untrusted networks from reaching the Portainer API while the instance is uninitialised. Remove the restriction once an admin account has been created and initial setup is complete.\n- **Complete initial setup immediately after deployment.** The initialization endpoints stop accepting requests once the instance has an administrator account. Minimising the uninitialised window limits the exploitation opportunity.\n- **Audit existing deployments for unauthorised admin accounts.** If a deployment may have been accessible before setup was completed, review the admin account list and rotate all credentials.\n\nNone of these replace the fix.\n\n## Affected Code\nThe vulnerability is in `api/http/handler/backup/handler.go` and `api/http/handler/backup/restore.go`. The handler registers the restore endpoint with `bouncer.PublicAccess`, bypassing all authentication middleware:\n\n```go\n// api/http/handler/backup/handler.go — NewHandler\nh.Handle(\"/restore\", bouncer.PublicAccess(httperror.LoggerHandler(h.restore))).Methods(http.MethodPost)\n```\n\nThe restore handler then checks only whether the instance has been initialised before proceeding:\n\n```go\n// api/http/handler/backup/restore.go — restore\nfunc (h *Handler) restore(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {\n    initialized, err := h.adminMonitor.WasInitialized()\n    if err != nil {\n        return httperror.InternalServerError(\"Failed to check system initialization\", err)\n    }\n    if initialized {\n        return httperror.BadRequest(\"Cannot restore already initialized instance\", errors.New(\"system already initialized\"))\n    }\n    h.adminMonitor.Stop()\n    // Proceeds to restore the archive unconditionally\n```\n\nThe fix introduces a one-time setup token that gates the public initialization endpoints — both administrator account creation (`/api/users/admin/init`) and restore (`/api/restore`) — while an instance is uninitialised. On startup, when no administrator account exists and no admin password was supplied through configuration, Portainer generates a cryptographically random token and writes it to the server logs. The restore and admin-init handlers reject any request that does not present this token in an `X-Setup-Token` header, returning `403 Forbidden`. Deployments that provision the administrator password at deploy time (`--admin-password` / `--admin-password-file`) require no token; the requirement can be pinned to an operator-chosen value (`--setup-token`) or disabled on trusted networks (`--no-setup-token`). The same change is backported to `release/2.39` for the 2.39.4 release.\n\n## Impact\n- **Full administrative access to Portainer.** The attacker replaces the database with one containing their own admin credentials and can then authenticate as a full administrator with no legitimate-user involvement.\n- **Host-level compromise.** Portainer CE typically runs with access to the Docker socket (`/var/run/docker.sock`); an attacker with Portainer admin access can use container creation APIs to mount the host filesystem and execute commands as root.\n- **Access to all managed environments.** The compromised Portainer admin account has credentials and API access for every Docker host, Kubernetes cluster, and edge agent registered in that instance, including any stored registry credentials, environment variables, and secrets.\n- **Persistence across credential changes.** Because the attacker controls the database, they can re-insert admin credentials or maintain secondary accounts even if a legitimate user later resets the primary password via the UI.\n\n## Timeline\n- 2026-05-07: Reported privately by **um3b0shi**.\n- 2026-06-04: Fix merged to `develop`.\n- 2026-06-24: 2.43.0 (STS) released with the fix.\n- 2026-06-25: 2.39.4 (LTS) released with the backported fix.\n\n## Credit\n- **um3b0shi** — discovered and reported the unauthenticated admin takeover via the `/api/restore` endpoint. Coverage of the companion administrator-account-creation endpoint (`/api/users/admin/init`) was added by the Portainer team as part of the fix.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/portainer/portainer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.39.0"
      }, {
        "fixed" : "2.39.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/portainer/portainer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.40.0"
      }, {
        "fixed" : "2.43.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/portainer/portainer/security/advisories/GHSA-x626-fcwx-f5pc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-55761"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/portainer/portainer/issues/2770"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/portainer/portainer/commit/49f19107cf9a3540cbe406c9eb7f24390e1af02b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/portainer/portainer/commit/d2b56efcb4e43c4168bb6688eee9f6bf22867312"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/portainer/portainer"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/portainer/portainer/releases/tag/2.39.4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/portainer/portainer/releases/tag/2.43.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-28T20:28:19Z",
    "nvd_published_at" : "2026-07-08T16:16:31Z"
  }
}