Skip to main content

MidnightBSD mport CVE-2026-54576

| EUVDEUVD-2026-82329 MEDIUM
Improper Link Resolution Before File Access (CWE-59)
2026-09-17 GitHub_M
5.8
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Gain local write access to install target directory
  2. Delivery
    Await/trigger privileged package install
  3. Exploit
    Replace extracted file with symlink mid-install
  4. Execution
    Privileged chown/chmod follows symlink to attacker path
  5. Impact
    Attacker gains ownership/permissions on protected file

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Symlink resolution safety
Exploitation Conditions

Requires local access to a MidnightBSD system AND pre-existing write permission to a directory targeted by an mport package install, so the attacker can substitute a symlink for a just-extracted file. Exploitation further requires winning a narrow TOCTOU race window between file extraction and the privileged lstat/chown/stat/chmod sequence in do_actual_install() (reflected as AC:H/AT:P), and depends on a privileged install (typically root running mport) actually being performed while the attacker is racing. Limiting factors: no remote vector (AV:L), attacker must already be a local, partially-privileged user (PR:L), timing is non-trivial, and only mport versions prior to 2.7.8 are affected - hosts on 2.7.8+ (fd-based fchown/fchmod with O_NOFOLLOW) are not exploitable.

Impact

This is a genuine but low-priority, high-gate integrity issue rather than a broadly exploitable flaw. The vendor CVSS 4.0 vector (AV:L/AC:H/AT:P/PR:L/UI:N, VC:N/VI:H/VA:L) is internally consistent with the description and the fix: exploitation is LOCAL, requires the attacker to already hold write access to a package install target directory (PR:L), demands winning a narrow TOCTOU race between file extraction and the privileged chown/chmod (AC:H plus AT:P attack-requirement), and yields no confidentiality impact (VC:N) - only filesystem integrity/permission compromise (VI:H) and minor availability effects (VA:L). No EPSS score, no CISA KEV listing, and no public exploit code are present in the input, so exploitation status is: no public exploit identified at time of analysis. All signals agree on modest real-world risk; there is no CVSS-vs-description conflict. The one metadata conflict worth flagging: the 'Information Disclosure' tag contradicts the VC:N (no confidentiality) in the vendor vector - this vulnerability discloses nothing and the tag is mislabeled. A fix is confirmed available (2.7.8, PR #150, commit 4676ac0), which further lowers urgency for anyone who can update.

Exploit ScenarioDerived

On a multi-user MidnightBSD host, a local attacker who can write to a directory where a package is about to be installed pre-plants or races a symlink into place: after mport extracts a regular file but before it applies the packaged ownership/mode, the attacker replaces that file with a symlink pointing at a sensitive target (e.g. a system file). The privileged install process then follows the symlink and applies chown/chmod to the attacker-chosen path, granting the attacker ownership or weakened permissions on a file they should not control. No public exploit code is identified, and success depends on winning a timing race (AC:H/AT:P).

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

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

Alert me

AnalysisAIv1 – Sep 17, 2026

Filesystem integrity compromise in MidnightBSD's mport package manager (versions prior to 2.7.8): a local user who already holds write access to a directory targeted by a package installation can race a symlink substitution between file extraction and the privileged ownership/mode changes that follow, redirecting a root-run chown/chmod onto an attacker-chosen path. Exploitation is heavily gated - it requires an authenticated local attacker with pre-existing directory write permission, a privileged install actually in progress, and a successful win of a narrow TOCTOU window (consistent with the assessed AV:L/AC:H/PR:L vector, High integrity and Low availability impact) - so this is a genuine but low-priority integrity issue rather than a broadly exploitable flaw. No public exploit code was identified at time of analysis and there is no evidence of active exploitation; mport 2.7.8 closes the race by switching to descriptors opened with O_NOFOLLOW and fchown/fchmod.

RemediationAI

Vendor-released patch: upgrade mport to version 2.7.8 (https://github.com/MidnightBSD/mport/releases/tag/2.7.8), which contains the fix from PR #150 / commit 4676ac05b1056b54a3d38d03ae8a478bf12c9abe; verify the installed mport build reports 2.7.8 or later before considering the host remediated. Until the upgrade can be applied, the most effective compensating control is to remove the attacker's precondition rather than the race itself: audit package installation target directories (prefixes such as /usr/local and any custom install roots) and ensure they are owned by root and not writable by unprivileged or partially-privileged users, since the attack requires pre-existing write access to a directory mport installs into - the trade-off is that shared or user-owned install prefixes will no longer accept unprivileged writes and some multi-user workflows may break. Alternatively, stage all privileged installs from a root-owned directory with mode 0755 that is never group- or world-writable, avoiding package installation directly into user-controlled or world-writable paths; this constrains where packages can be deployed and may require reworking per-user installation procedures. As a detective measure, periodically audit installed trees for unexpected symlinks in package-managed directories and for files whose ownership or mode changed outside a known package transaction, though detection after the fact cannot undo a redirected chmod. No vendor-released patch beyond 2.7.8 is identified as necessary, and there is no public exploit code or confirmed active exploitation to justify emergency mitigations beyond upgrading.

Affected VersionsENISA

mport < 2.7.8

Affected Packages

euvd mport fix: 2.7.8

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

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

Technical ContextAI · show details

The flaw is a classic time-of-check/time-of-use symlink-following race (CWE-59, Link Following) in do_actual_install() within libmport/bundle_read_install_pkg.c. After a package file is extracted, the vulnerable code re-resolved the path with lstat(), chown(), stat() and chmod(), meaning each of those privileged operations performed its own fresh path lookup. Between the extraction/check step and the ownership or mode change, an attacker who can write to the destination directory could unlink the extracted regular file and substitute a symlink; the subsequent chown()/chmod() would then follow that link and apply root-level ownership or permission changes to a file of the attacker's choosing, corrupting permissions elsewhere on the filesystem. The upstream fix in PR #150 (commit 4676ac05b1056b54a3d38d03ae8a478bf12c9abe) opens the freshly extracted file once with open(file, O_RDONLY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC), verifies it is a regular file via fstat(), and then performs fchown()/fchmod() on the descriptor rather than on the path, so a swapped symlink (EMLINK/ELOOP) can no longer redirect the privileged operations; O_NONBLOCK prevents hanging if the path was replaced by a FIFO, and the descriptor is closed on all exit paths including the ERROR path. This mirrors the descriptor-based directory handling already used in apply_dir_asset_attrs(). The affected component is identified by CPE cpe:2.3:a:midnightbsd:mport:*:*:*:*:*:*:*:*. Note that the associated advisory tags include "Information Disclosure", but the authoritative assessment and the patch itself describe an integrity/availability impact (redirected ownership and permissions), not data exposure, so the disclosure tag should not be read as the primary effect.

Know when Mport 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 (GitHub_M) PRIMARY 5.8 MEDIUM
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N
vuln.today AI 5.3 MEDIUM

Local attacker with write access to the install path (AV:L/PR:L) must win a symlink TOCTOU race (AC:H); impact is integrity/permission compromise (I:H) with minor availability (A:L) and no confidentiality (C:N).

3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:L
4.0 AV:L/AC:H/AT:P/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

1
Patch available
Sep 17, 2026 - 18:19 EUVD

DescriptionCVE.org

mport is the MidnightBSD Package Manager. Prior to 2.7.8, do_actual_install() in libmport/bundle_read_install_pkg.c used path-based lstat(), chown(), stat(), and chmod() operations while installing package files. A local attacker with write access to a target directory could replace a checked file with a symlink before privileged ownership or mode changes were applied, redirecting those changes to an attacker-selected path and compromising filesystem integrity or permissions. This issue is fixed in version 2.7.8.

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
Prevalence
Rare
MidnightBSD is an obscure hobby BSD fork with negligible production footprint
Data Quality
4 sources
Confidence: Medium

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.1%
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
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

More in Mport

View all
CVE-2026-54580 HIGH
8.3 Sep 17

Package-index corruption and denial of package-management operations affect MidnightBSD mport before 2.7.8 when a malici

CVE-2026-54583 HIGH
8.3 Sep 17

Path traversal in the MidnightBSD mport package manager (libmport/fetch.c) before version 2.7.8 lets an attacker who con

CVE-2026-54581 HIGH
8.3 Sep 17

MidnightBSD's mport package manager prior to 2.7.8 can accept a tampered bootstrap package index as verified, because th

CVE-2026-54586 MEDIUM
6.0 Sep 17

On-path tampering with package-fetch traffic in MidnightBSD's mport package manager lets a network-positioned attacker s

CVE-2026-54585 MEDIUM
6.0 Sep 17

Path traversal in MidnightBSD mport before 2.7.8 allows a crafted package manifest to make the privileged sample-file ha

CVE-2026-54582 MEDIUM
6.0 Sep 17

Package file overwrite in MidnightBSD mport prior to 2.7.8 allows a crafted package installed with privileges to replace

CVE-2026-54575 MEDIUM
5.8 Sep 17

Path-racing and shell-invocation weaknesses in the MidnightBSD mport package manager (all versions prior to 2.7.8) let a

CVE-2026-54587 MEDIUM
5.8 Sep 17

Symlink following and dot-dot path traversal in MidnightBSD mport prior to 2.7.8 lets a local attacker who can already w

CVE-2026-54584 MEDIUM
5.3 Sep 21

MidnightBSD's mport package manager before 2.7.8 trusts the TMPDIR environment variable when extracting package metafile

CVE-2026-54579 LOW
2.3 Sep 17

Spoofed or injected ICMP echo replies can steer mport's mirror-latency selection toward an attacker-chosen mirror and, i

CVE-2026-54577 LOW
2.0 Sep 17

MidnightBSD's mport package manager, in all versions prior to 2.7.8, mis-parses the argument list for its 'audit' subcom

CVE-2026-54578 LOW
2.0 Sep 17

Checksum verification in MidnightBSD's mport package manager before 2.7.8 can silently continue after a hashing failure,

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy