Skip to main content

Portainer CVE-2026-44884

MEDIUM
Missing Authorization (CWE-862)
2026-05-14 https://github.com/portainer/portainer GHSA-cqpq-2fgr-8mvc
6.0
CVSS 4.0 · Vendor: https://github.com/portainer/portainer
View

Attack ChainAIDerived

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

  1. Access
    Obtain valid Portainer user account
  2. Delivery
    Authenticate to Portainer REST API
  3. Exploit
    Enumerate sequential IDs via GET /api/custom_templates/{id}/file
  4. Execution
    Receive verbatim Docker Compose file contents
  5. Persist
    Extract embedded secrets (DB strings, API tokens, registry credentials)
  6. Impact
    Pivot to downstream systems

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization checks on every request
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

Exploitation requires a valid Portainer user account at any privilege level - even the lowest-privilege standard user role is sufficient, and no administrative rights are needed. At least one custom template must exist in the Portainer instance (i.e., an administrator must have previously created a custom template with file content). The attacker must have network access to the Portainer API endpoint. No special configuration, non-default settings, or specific platform beyond a standard unpatched Portainer deployment is required. Exploitation is strictly limited to authenticated sessions - fully unauthenticated external access to this endpoint is not possible. The practical blast radius is further bounded by two factors: the attacker must already hold a Portainer account, meaning a wholly external attacker must first obtain valid credentials before exploiting this issue; and the impact is limited to template file confidentiality with no direct code execution or privilege escalation chain described in the advisory.

Impact

No CVSS vector or EPSS score is provided in the available data, limiting quantitative risk scoring. The vendor assigns Medium severity. Exploitation requires authentication - an attacker must hold a valid Portainer user account, even the lowest-privilege standard user role suffices - which is consistent with PR:L in CVSS terms, though this cannot be formally confirmed from a vector string since none is available. Attack complexity is effectively low once authenticated: sequential integer ID enumeration is trivially scriptable and requires no specialized tooling. The primary impact is confidentiality - specifically the exposure of secrets embedded in Docker Compose templates, which may include database connection strings, API tokens, and registry credentials. There is no KEV listing and no POC identified at time of analysis, suggesting this has not been observed in active exploitation. The practical risk is elevated in multi-tenant Portainer deployments where standard users coexist with administrators managing infrastructure secrets; single-user or fully trusted-user deployments face lower realized risk. The absence of a CVSS vector means attack vector, scope, and integrity/availability impact cannot be formally assessed from available data.

Exploit ScenarioDerived

An authenticated Portainer user with a standard (non-admin) account sends sequential GET requests to /api/custom_templates/1/file, /api/custom_templates/2/file, and so on, iterating through integer IDs with a simple script or curl loop. For each valid template ID, the server returns the raw Docker Compose file contents verbatim without any authorization check, including any embedded environment variables, connection strings, or registry credentials that an administrator stored when creating the template. The attacker then uses harvested credentials for lateral movement into databases, container registries, or external APIs referenced in those templates. No public proof-of-concept code has been identified at time of analysis, though the attack requires no specialized tooling beyond standard HTTP request capability.

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

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

Alert me

AnalysisAIv1 – May 26, 2026

Portainer's custom template file endpoint (GET /api/custom_templates/{id}/file) exposes template file contents to any authenticated user due to a completely absent authorization check in the customTemplateFile handler - a check that every other custom template endpoint correctly implements. Authenticated users at any privilege level can enumerate sequential integer template IDs to read Docker Compose files belonging to templates they have no explicit access to, potentially harvesting embedded secrets such as database connection strings, API tokens, and registry credentials. No public exploit or CISA KEV listing has been identified at time of analysis; however, exploitation requires only a valid session and sequential ID guessing, making it trivially scriptable against any unpatched multi-tenant Portainer instance.

RemediationAI

The primary fix is to upgrade to a patched release: Portainer 2.33.8 for users on the 2.33.x LTS branch (release notes at https://github.com/portainer/portainer/releases/tag/2.33.8) or Portainer 2.39.1 for users on the 2.39.x LTS branch (https://github.com/portainer/portainer/releases/tag/2.39.2); users already on 2.40.0 or later are not affected and require no action. For administrators who cannot immediately upgrade, the vendor offers two compensating controls, neither of which substitutes for patching: first, stop embedding secrets in custom template files and migrate sensitive values to Portainer environment variables or an external secret store - this prevents new credential exposure but does not block enumeration of existing templates; second, audit all existing custom templates for embedded credentials and rotate any secrets that may have been accessible to standard users, treating them as fully compromised given that any authenticated user could have read them. Users on EOL versions prior to 2.33.0 must upgrade to a supported LTS release, as no backport will be issued for those versions.

Affected Packages

go github.com/portainer/portainer fix: 2.33.8, 2.39.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in go

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

Technical ContextAI · show details

Portainer is a container management platform written in Go (pkg:go/github.com/portainer/portainer) that exposes a REST API for managing Docker and Kubernetes environments. The vulnerable component is the customTemplateFile HTTP handler in api/http/handler/customtemplates/customtemplate_file.go (lines 30-53). Custom templates are stored with sequential integer IDs and may include Docker Compose files containing environment-specific configuration. CWE-862 (Missing Authorization) identifies the root cause: the handler retrieves and returns template file content based solely on a caller-supplied numeric ID without invoking any of Portainer's existing authorization primitives - specifically userCanEditTemplate(), UserCanAccessResource(), or FilterAuthorizedCustomTemplates(). The Resource Control system that governs access to Portainer resources is entirely bypassed for this specific endpoint, while all sibling endpoints (inspect via GET /api/custom_templates/{id}, update via PUT, delete, and list) correctly enforce access controls.

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/portainer/portainer) PRIMARY 6.0 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
SUSE MEDIUM

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

CVSS VectorVendor: https://github.com/portainer/portainer

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
May 28, 2026 - 22:22 NVD
6.0 (MEDIUM)

DescriptionCVE.org

Summary

A missing authorization vulnerability in the Custom Template file endpoint (GET /api/custom_templates/{id}/file) allows any authenticated user to read the file content of any custom template by enumerating sequential integer IDs, bypassing Resource Control access restrictions. Template files may contain environment-specific values such as connection strings, API tokens, or registry credentials that administrators would not expect standard users to read.

Severity

Medium

CWE-862 - Missing Authorization

Exploitation requires an authenticated user account and at least one custom template to exist. Template files are returned verbatim and may contain embedded credentials.

Affected Versions

The vulnerability exists in every Portainer release since custom templates were introduced - the customTemplateFile handler has never performed an authorization check.

Fixes are included in the following releases:

BranchFirst vulnerableFixed in
2.33.x (LTS)2.33.02.33.8
2.39.x (LTS)2.39.02.39.1

Portainer 2.40.0 and later are not affected - the fix was already on develop when the 2.40.x STS line branched. Portainer LTS branches receive fixes for 6 months plus a 3-month overlap after the next LTS ships. All releases prior to 2.33.0 are end-of-life and will not receive a fix; users on EOL versions should upgrade to a supported release.

Workarounds

There is no runtime configuration that blocks the vulnerable endpoint directly. Administrators who cannot immediately upgrade can reduce exposure by:

  • Avoiding storing secrets in custom templates until the patched release is deployed. Move sensitive configuration values to Portainer environment variables or an external secret store.
  • Reviewing existing custom templates for embedded secrets. Assume any secret previously stored in a custom template on an unpatched instance has been exposed to every authenticated user and rotate accordingly.

Neither replaces the fix.

Affected Code

The customTemplateFile handler in api/http/handler/customtemplates/customtemplate_file.go (lines 30-53) retrieves a custom template by its numeric ID and returns the file content without performing any authorization check.

All other custom template endpoints properly verify access:

EndpointMethodAuthorization Check
/api/custom_templates/{id}GET (inspect)userCanEditTemplate() + UserCanAccessResource()
/api/custom_templates/{id}PUT (update)userCanEditTemplate()
/api/custom_templates/{id}DELETEuserCanEditTemplate()
/api/custom_templatesGET (list)FilterAuthorizedCustomTemplates()
/api/custom_templates/{id}/fileGETNone

Vulnerable code (customtemplate_file.go:30-53):

go
func (handler *Handler) customTemplateFile(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
    customTemplateID, _ := request.RetrieveNumericRouteVariableValue(r, "id")
    customTemplate, _ := handler.DataStore.CustomTemplate().Read(portainer.CustomTemplateID(customTemplateID))
    // NO AUTHORIZATION CHECK
    fileContent, _ := handler.FileService.GetFileContent(customTemplate.ProjectPath, entryPath)
    return response.JSON(w, &fileResponse{FileContent: string(fileContent)})
}

Secure reference (customtemplate_inspect.go:50-75):

go
canEdit := userCanEditTemplate(customTemplate, securityContext)
hasAccess := authorization.UserCanAccessResource(securityContext.UserID, teamIDs, resourceControl)
if !canEdit && !hasAccess {
    return httperror.Forbidden("Access denied to resource", httperrors.ErrResourceAccessDenied)
}

Impact

Any authenticated user (including the lowest-privilege standard user) can read the file content of every custom template in the instance. Custom templates commonly contain Docker Compose configuration, which may include environment-specific secrets such as database connection strings, API tokens, or registry credentials.

Timeline

  • 2026-02-11: Reported via GitHub Security Advisory by duddnr0615k.
  • 2026-03-04: Fix merged to develop and cherry-picked to release/2.39.
  • 2026-03-19: 2.39.1 released with fix.
  • 2026-03-25: 2.40.0 released with fix already present from branch cut.
  • 2026-05-07: 2.33.8 released.

Credit

  • duddnr0615k - identified and reported the missing authorization check on the custom template file endpoint.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium
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.0%
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

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

Affected Products (CPE)CVE.org

pkg:go/github.com_portainer_portainer
pkg:go/github.com_portainer_portainer

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
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