Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-44884 — portainer

🟡 CVSS 6.5 — Medium ✅ No Known Exploit CWE-862 NVD
6.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Portainer missing authorization on custom template file endpoint, which exposes template content

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

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

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs low-level 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 none, availability none.

CVSS metrics in full

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

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: Low — an ordinary user account is enough.
  • 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: None.
  • Availability impact: None.

Weakness class

CVE-2026-44884 is classified as CWE-862: Missing Authorization. No authorisation check is performed before carrying out a restricted action.

Affected software

CVE-2026-44884 is recorded against 2 packages.

  • github.com/portainer/portainer
  • portainer (from 2.39.0 up to 2.39.1)

Timeline and source

Published on 25 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Advisory)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)

Other advisories for this package

github.com/portainer/portainer 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-862: Missing Authorization) in other software:

Details

Severity Medium
CVSS Score 6.5
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
CWE CWE-862
Public Exploit ✅ No
Source NVD
Published 2026-06-25
Updated 2026-08-20
Modified 2026-06-25
Fix URL N/A

Affected Packages

Software From version Fixed in
github.com/portainer/portainer — —
portainer 2.39.0 2.39.1

Similar Threats

Vulnerability Monitoring

Track new vulnerabilities in portainer

CVE-2026-44884 is rated CVSS 6.5 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

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
✓