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:
| Branch | First vulnerable | Fixed in |
|---|---|---|
| 2.33.x (LTS) | 2.33.0 | 2.33.8 |
| 2.39.x (LTS) | 2.39.0 | 2.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:
| Endpoint | Method | Authorization Check |
|---|---|---|
/api/custom_templates/{id} |
GET (inspect) | userCanEditTemplate() + UserCanAccessResource() |
/api/custom_templates/{id} |
PUT (update) | userCanEditTemplate() |
/api/custom_templates/{id} |
DELETE | userCanEditTemplate() |
/api/custom_templates |
GET (list) | FilterAuthorizedCustomTemplates() |
/api/custom_templates/{id}/file |
GET | None |
Vulnerable code (customtemplate_file.go:30-53):
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):
canEdit := userCanEditTemplate(customTemplate, securityContext)
hasAccess := authorization.UserCanAccessResource(securityContext.UserID, teamIDs, resourceControl)
if !canEdit && !hasAccess {
return httperror.Forbidden("Access denied to resource", httperrors.ErrResourceAccessDenied)
}
Timeline
- 2026-02-11: Reported via GitHub Security Advisory by duddnr0615k.
- 2026-03-04: Fix merged to
developand cherry-picked torelease/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.
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.
The application does not perform an authorization check before performing a sensitive operation. Typical impact: unauthorized access to restricted functionality or data.
CVE-2026-44884 has a CVSS score of 6.5 (Medium). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.33.8, 2.39.1); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
github.com/portainer/portainer to 2.33.8 or later; github.com/portainer/portainer to 2.39.1 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-44884? CVE-2026-44884 is a medium-severity missing authorization vulnerability in github.com/portainer/portainer (go), affecting versions >= 2.33.0, < 2.33.8. It is fixed in 2.33.8, 2.39.1. The application does not perform an authorization check before performing a sensitive operation.
- How severe is CVE-2026-44884? CVE-2026-44884 has a CVSS score of 6.5 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/portainer/portainer are affected by CVE-2026-44884? github.com/portainer/portainer (go) versions >= 2.33.0, < 2.33.8 is affected.
- Is there a fix for CVE-2026-44884? Yes. CVE-2026-44884 is fixed in 2.33.8, 2.39.1. Upgrade to this version or later.
- Is CVE-2026-44884 exploitable, and should I be worried? Whether CVE-2026-44884 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-44884 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-44884?
- Upgrade
github.com/portainer/portainerto 2.33.8 or later - Upgrade
github.com/portainer/portainerto 2.39.1 or later
- Upgrade