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

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.42%, higher than 38% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-02-13T18:10:26.325Z
- Modified: 2026-06-17T10:19:04.633Z
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- bacnet-stack bacnet-stack: < 1.5.0.rc3
- bacnetstack bacnet_stack: 1.5.0

## References

- <https://github.com/bacnet-stack/bacnet-stack/security/advisories/GHSA-p8rx-c26w-545j> (exploit, vendor-advisory)
- <https://github.com/bacnet-stack/bacnet-stack/commit/c5dc00a77b4bc2550befa67a930b333e299c18f3> (patch)

## Sources

- CVE List: [CVE-2026-21878](https://www.cve.org/CVERecord?id=CVE-2026-21878), CVE Terms of Use, modified 2026-02-13
- NVD: [CVE-2026-21878](https://nvd.nist.gov/vuln/detail/CVE-2026-21878), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-21878 · Whole record: https://cve.day/CVE-2026-21878.json · Rebuilt by cve.day 2026-11-25T22:59:13.848Z
