CVE-2026-21878

BACnet Stack Improperly Limits Pathnames to a Restricted Directory

Published Feb 13, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
BACnet Stack is a BACnet open source protocol stack C library for embedded systems. Prior to 1.5.0.rc3, a vulnerability has been discovered in BACnet Stack's file writing functionality where there is no validation of user-provided file paths, allowing attackers to write files to arbitrary directories. This affects apps/readfile/main.c and ports/posix/bacfile-posix.c. This vulnerability is fixed in 1.5.0.rc3.

Analysis

AI-generated

Technical impact

BACnet Stack’s file‑writing functions fail to validate user‑supplied file paths, permitting attackers to write files to any filesystem location. This flaw is a classic example of an uncontrolled path traversal (CWE‑22) that can compromise confidentiality, integrity, or availability if critical files are altered or malicious payloads are deployed. The vulnerability is present in the libraries used by apps/readfile/main.c and ports/posix/bacfile‑posix.c, allowing write operations without directory restriction.

Affected Systems

The affected product is the BACnet Stack library from the bacnet-stack project. Versions 1.5.0 rc1 and rc2 are vulnerable; the issue is resolved in 1.5.0 rc3 and later releases. The flaw is relevant to embedded systems that use the BACnet protocol stack for building automation, HVAC, and related industrial control settings.

Risk and Exploitability

The CVSS score of 7.5 indicates high severity, while the EPSS score of less than 1% reflects a low current exploitation probability. The vulnerability is not listed in the CISA KEV catalog, but the potential impact of uncontrolled file writes is significant. The likely attack vector is an adversary that can invoke the BACnet stack’s file writing interface—either remotely or locally—together with any utility that specifies file paths. Successful exploitation would allow an attacker to create, modify, or delete files anywhere on the device’s filesystem.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade BACnet Stack to version 1.5.0 rc3 or later to apply the vendor patch that validates file paths
  • If upgrading is not immediately possible, disable or restrict the file‑write functionality in the application or remove the components (apps/readfile/main.c and ports/posix/bacfile‑posix.c) that expose the vulnerability
  • Set strict filesystem permissions on the target device so that the BACnet process runs with the minimum privileges required, preventing arbitrary file modifications

Generated by OpenCVE AI on April 17, 2026 at 19:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:bacnetstack:bacnet_stack:1.5.0:rc1:*:*:*:*:*:*
cpe:2.3:a:bacnetstack:bacnet_stack:1.5.0:rc2:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Bacnetstack
Bacnetstack bacnet Stack
Vendors & Products Bacnetstack
Bacnetstack bacnet Stack
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description BACnet Stack is a BACnet open source protocol stack C library for embedded systems. Prior to 1.5.0.rc3, a vulnerability has been discovered in BACnet Stack's file writing functionality where there is no validation of user-provided file paths, allowing attackers to write files to arbitrary directories. This affects apps/readfile/main.c and ports/posix/bacfile-posix.c. This vulnerability is fixed in 1.5.0.rc3.
Title BACnet Stack Improperly Limits Pathnames to a Restricted Directory
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}

Weaknesses
  • CWE-22

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Feb 13, 2026, 6:53 PM
Reserved
Jan 5, 2026, 5:24 PM
Status
Analyzed
Published
Feb 13, 2026, 7:17 PM
Modified
Jun 17, 2026, 10:19 AM