CVE-2026-54584

mport trusts environment-controlled temporary directories in privileged metadata extraction

Published Sep 21, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
mport is the MidnightBSD Package Manager. mport before 2.7.8 used TMPDIR while extracting package metafiles, including when running as root or in setuid/setgid contexts. An attacker able to control the environment for a privileged mport invocation could redirect temporary metadata extraction to an attacker-controlled location. PR 123 ignores unsafe TMPDIR values in privileged contexts and rejects empty TMPDIR. This issue has been patched in version 2.7.8.

Analysis

AI-generated

Technical impact

The vulnerability arises because mport uses the TMPDIR environment variable to locate temporary files used during package metadata extraction even when it runs with elevated privileges or as a setuid binary. This design flaw allows an attacker who can set environment variables for a privileged mport invocation to direct the extraction to an arbitrary directory controlled by the attacker. By doing so, the attacker can influence the location where sensitive metadata files are written, potentially enabling the placement of malicious content or the modification of files that are later processed during package installation. The flaw is identified as CWE-377 and CWE-73.

Affected Systems

MidnightBSD mport, the package manager for the MidnightBSD operating system, is affected. The issue exists in all releases prior to version 2.7.8. Both the pre‑2.7.8 and earlier stable series use the vulnerable TMPDIR handling in privileged contexts.

Risk and Exploitability

The CVSS score of 5.3 classifies the vulnerability as medium severity. The EPSS score is not available, indicating no publicly known exploit data, and the risk is not listed in the CISA KEV. The likely attack vector is local exploitation, requiring the attacker to control the environment for a privileged invocation of mport, such as through a compromised user session or by running mport with setuid permissions in a malicious environment. After patching to 2.7.8, the temporary directory is validated and any empty or unsafe TMPDIR values are rejected, removing the attack surface.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade MidnightBSD mport to version 2.7.8 or later, which validates TMPDIR in privileged contexts and rejects unsafe values.
  • If an upgrade cannot be performed immediately, ensure that no TMPDIR variable is set when running privileged mport, or set TMPDIR to a directory owned by a non‑privileged user that cannot be modified by the attacker.
  • Monitor system logs for abnormal package installation activity that could indicate tampering or suspicious file placement.

Generated by OpenCVE AI on September 21, 2026 at 16:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Midnightbsd
Midnightbsd mport
Vendors & Products Midnightbsd
Midnightbsd mport
Type Values Removed Values Added
Description mport is the MidnightBSD Package Manager. mport before 2.7.8 used TMPDIR while extracting package metafiles, including when running as root or in setuid/setgid contexts. An attacker able to control the environment for a privileged mport invocation could redirect temporary metadata extraction to an attacker-controlled location. PR 123 ignores unsafe TMPDIR values in privileged contexts and rejects empty TMPDIR. This issue has been patched in version 2.7.8.
Title mport trusts environment-controlled temporary directories in privileged metadata extraction
Weaknesses CWE-377
CWE-73
References
Metrics cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-377

    Insecure Temporary File

  • CWE-73

    External Control of File Name or Path

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 25, 2026, 7:23 PM
Reserved
Jun 15, 2026, 7:15 PM
Status
Deferred
Published
Sep 21, 2026, 3:17 PM
Modified
Sep 25, 2026, 8:17 PM