Skip to main content

Portainer CVE-2026-44885

MEDIUM
Path Traversal (CWE-22)
2026-05-14 https://github.com/portainer/portainer GHSA-m8fg-67j7-cx4v
5.5
CVSS 3.1 · Vendor: https://github.com/portainer/portainer
View

Attack ChainAIDerived

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

  1. Recon
    Obtain admin credentials (phishing or compromise)
  2. Delivery
    Create malicious tar.gz with path traversal entry (e.g., ../../etc/cron.d/evil)
  3. Exploit
    Deliver archive to administrator or infiltrate backup storage
  4. Install
    Authenticate to Portainer backup restore endpoint
  5. C2
    Initiate restore of malicious archive
  6. Execute
    ExtractTarGz function writes file outside extraction root
  7. Impact
    Arbitrary file execution on server filesystem

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires: (1) Valid administrator credentials to access Portainer's backup restore endpoint, either through direct login or credential compromise. (2) The ability to provide or control the backup archive being restored-the attacker must either socially engineer an administrator into restoring a malicious archive or have direct control over the backup restore input mechanism. (3) The targeted Portainer version must be prior to 2.39.0 (or prior to 2.33.8 for LTS installations). The vulnerability is NOT limited to non-default configurations; it affects any Portainer deployment using the backup restore feature without patching. Portainer's optional backup encryption feature, if enabled with a strong passphrase, acts as a protective control by requiring the correct key to decrypt the archive before extraction-an attacker without the key cannot craft a valid encrypted archive, effectively blocking exploitation. However, if encryption is disabled (the default), no such protection exists. The path traversal requires only standard tar archive format and does not depend on specific operating system behaviors; both Linux and Windows deployments are affected, though impact differs (Windows file permissions are less restrictive for system directories, potentially increasing risk).

Impact

CVSS 5.5 (AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:L) reflects medium severity with high integrity impact and low availability impact, but critically constrained by PR:H (high privilege requirement). This is an authenticated vulnerability requiring administrative access to Portainer's backup restore endpoint. Real-world risk depends on three factors: (1) How frequently administrators restore archives from external or untrusted sources, (2) Whether administrator credentials can be compromised, and (3) What host filesystem paths are accessible to the Portainer process (typically extensive in containerized deployments running as root). The CVSS vector accurately captures the impact-arbitrary file write-but the mandatory administrator authentication significantly limits exploitability compared to an unauthenticated path traversal. No public exploit code or active exploitation has been identified at time of analysis. The vendor provided a concrete remediation with patched versions available (2.39.0 general release, 2.33.8 LTS backport), reducing urgency for organizations that can test and deploy updates. However, organizations running Portainer versions 2.33.0-2.38.x and unable to upgrade immediately face genuine risk if administrators are socially engineered or if backup files are obtained from untrusted sources. The workarounds (restrict archive sources, use backup encryption) provide practical interim protection without requiring patching.

Exploit ScenarioDerived

An administrator at a company using Portainer 2.35.0 receives a backup archive via email or downloads it from an untrusted website, claiming to be a shared Portainer configuration from another organization. The archive contains a malicious tar entry with the path ../../etc/cron.d/portainer-backdoor. When the administrator authenticates to Portainer and initiates a restore operation using this archive, the ExtractTarGz function extracts the malicious cron job outside the Portainer data directory to /etc/cron.d/, establishing persistent code execution on the host system. Alternatively, if Portainer runs as root (common in containerized deployments), an attacker with compromised administrator credentials could craft an archive containing entries like ../../root/.ssh/authorized_keys to inject SSH public keys and gain direct host access.

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

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

Alert me

AnalysisAIv1 – May 14, 2026

Path traversal in Portainer's backup restore feature allows arbitrary file write to the server filesystem via crafted tar.gz archives. Versions prior to 2.39.0 (and 2.33.8 in the LTS branch) use unsafe path joining in the ExtractTarGz function, permitting entries like ../../etc/cron.d/evil to escape the extraction root. An authenticated administrator who restores a malicious archive or whose credentials are compromised can write files to any path accessible to the Portainer process, potentially establishing persistence on the host. Exploitation requires administrative privileges within Portainer, reducing practical impact.

RemediationAI

Upgrade immediately to Portainer 2.33.8 (for LTS users) or 2.39.0 or later (for general release users). The patch replaces the unsafe filepath.Clean(filepath.Join()) construction with filesystem.JoinPaths, which enforces path containment and is confirmed in commit e02ae6b2fb69668d1cd7d07cb873dfcdd9cf1e42. Organizations unable to patch immediately should implement the following compensating controls: (1) Only restore backup archives from trusted, verified sources and restrict administrator access to the restore endpoint to authorized personnel only (trade-off: reduces convenience and team flexibility). (2) Enable Portainer's optional backup encryption feature with a strong passphrase; this prevents crafting valid malicious archives without the correct encryption key (trade-off: requires managing encryption keys and adds operational complexity). (3) Run Portainer in a restricted container with reduced host filesystem mount permissions and minimal UID/GID privileges to limit the scope of file-write impact (trade-off: may break legitimate functionality if Portainer requires broad host access). (4) Monitor the Portainer backup restore endpoint with audit logging and alerting to detect suspicious restore activities, particularly restores of unusually large or externally-sourced archives (trade-off: reactive rather than preventive). None of these workarounds eliminates the vulnerability; patching is the permanent fix. Refer to GitHub advisory GHSA-m8fg-67j7-cx4v for additional details.

Affected Packages

go github.com/portainer/portainer fix: 2.33.8

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

The vulnerability stems from CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) in the tar archive extraction logic. Portainer's ExtractTarGz function in api/archive/targz.go used the Go standard library functions filepath.Clean(filepath.Join(outputDirPath, header.Name)) to construct output paths from tar headers. While filepath.Join resolves relative path components and filepath.Clean normalizes the result, neither function validates that the final path remains within the intended extraction root directory. This permits directory traversal sequences (../) in tar entry names to resolve outside the trusted extraction boundary. The fix replaces the unsafe path construction with filesystem.JoinPaths, a custom function that forces all path components to be relative to the trusted root, preventing escape. The vulnerability has existed since ExtractTarGz was introduced and affects all Portainer releases before the fix was merged to develop on 2026-02-16.

Know when the next one hits your stack

  • 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 5.5 MEDIUM
AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:L
SUSE MEDIUM

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

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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
Low

DescriptionCVE.org

Summary

Portainer's backup restore feature accepts a .tar.gz archive and extracts it to a target directory on the server. The extraction function (ExtractTarGz in api/archive/targz.go) constructed output paths using filepath.Clean(filepath.Join(outputDirPath, header.Name)). This combination does not prevent directory traversal - a tar entry named ../../etc/cron.d/evil resolves to a path outside the extraction root, so a crafted archive can write files to arbitrary locations on the server filesystem.

Severity

Medium

CWE-22 - Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Exploitation requires administrator access to Portainer's backup restore endpoint. An administrator who is deceived into restoring a malicious archive, or whose credentials are compromised, can use this path to write files outside the Portainer data directory.

Affected Versions

The vulnerability exists in every Portainer release prior to 2.39.0 - ExtractTarGz has used filepath.Clean(filepath.Join()) since it was introduced. The fix shipped with 2.39.0 (patched on develop before the 2.39 branch cut); 2.34.x-2.38.x STS releases are also affected but are end-of-life and will not receive a fix.

BranchFirst vulnerableFixed in
2.33.x (LTS)2.33.02.33.8

Portainer 2.39.0 and later are not affected - the fix was present from the initial 2.39.0 release. 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

Administrators who cannot immediately upgrade should:

  • Only restore archives from trusted sources. Do not restore archives received from untrusted parties or transmitted over unencrypted channels.
  • Use backup encryption. Portainer's optional backup encryption requires the correct passphrase to decrypt before extraction; an attacker without the passphrase cannot craft a valid encrypted archive.

Neither of these replaces the fix.

Affected Code

ExtractTarGz in api/archive/targz.go constructed output paths without safe containment:

go
// api/archive/targz.go (pre-fix)
case tar.TypeReg:
    p := filepath.Clean(filepath.Join(outputDirPath, header.Name))

filepath.Join resolves ../ components lexically and filepath.Clean normalises the result, but neither verifies the final path remains inside outputDirPath. The fix replaces this with filesystem.JoinPaths, which forces all path components to be relative to the trusted root:

go
// api/archive/targz.go (post-fix)
case tar.TypeReg:
    p := filesystem.JoinPaths(outputDirPath, header.Name)

Impact

  • Arbitrary file write at any path accessible to the Portainer process (typically root in containerised deployments), overriding filesystem boundaries of the data directory.
  • Potential host persistence by writing to cron directories, SSH authorised key files, or executable paths, depending on how the container is configured and what host paths are accessible.

The practical severity is reduced because exploitation requires administrative privileges within Portainer.

Timeline

  • 2026-02-16: Fix merged to develop (#1875).
  • 2026-02-25: 2.39.0 released with fix.
  • 2026-05-07: 2.33.8 released with backport fix.

Credits

Reported by Kolega.

Threat Intelligence Overview

EPSS Score
0.2%
Top 51% 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.2%
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

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Affected Products (CPE)CVE.org

pkg:go/github.com_portainer_portainer

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