Severity by source
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Local attack with low-privilege shell access required; no confidentiality impact, only limited heap corruption and process abort affecting integrity and availability.
Primary rating from Vendor (cert).
CVSS VectorVendor: cert
Lifecycle Timeline
2DescriptionCVE.org
entr is vulnerable to Heap-based buffer overflow in run_utility() function. The function allocates a fixed-size heap buffer using malloc(ARG_MAX) and copies command-line arguments into it. It advances the destination pointer based on the return value of strlcpy(), which returns the total length of the source string rather than the number of bytes written. When the buffer is exactly filled, the remaining size underflows as an unsigned size_t, causing subsequent copies to write out of bounds. This can be triggered by supplying command-line arguments whose combined length fills the buffer, or via the /_ substitution feature which expands a short token into a longer pathname at runtime. The local attacker can cause memory corruption, process abort, and denial of service.
This issue was fixed in commit 2467fe0
AnalysisAI
Heap buffer overflow in entr's run_utility() function allows a local low-privileged user to trigger memory corruption, process abort, and denial of service by supplying crafted command-line arguments or by using the slash-underscore substitution feature, which expands a short token into a longer pathname at runtime. The flaw stems from incorrect use of strlcpy()'s return value - which reflects the total source length rather than bytes written - to advance a destination pointer, causing an unsigned size_t underflow in the remaining-buffer counter and subsequent out-of-bounds heap writes. No public exploit has been identified and this vulnerability is absent from CISA KEV; an upstream fix is available via commit 2467fe0.
Technical ContextAI
entr is an open-source, BSD-licensed file-watching utility that executes user-specified shell commands whenever monitored files change, commonly used in developer build loops and CI pipelines. The vulnerable function run_utility() allocates a fixed-size heap buffer of ARG_MAX bytes via malloc() and iterates over command-line arguments to clone them into this buffer on each invocation. The root cause is CWE-122 (Heap-based Buffer Overflow) arising from misuse of strlcpy(): the POSIX strlcpy() function returns the total length of the source string - not the number of bytes actually copied, which is capped by the size parameter. The original code used this uncapped return value to advance the destination pointer p, so when a string exactly fills remaining buffer space, the expression ARG_MAX - (p - arg_buf) wraps around to a very large unsigned value on the next iteration, and the subsequent copy writes arbitrarily far beyond the heap allocation. The slash-underscore substitution feature exacerbates this by replacing a short literal token with a full filesystem pathname at runtime, making the overflow triggerable without obviously long argument strings. The fix in commit 2467fe0 replaces strlcpy with an explicit strlen-based bounds check followed by memcpy, tracks remaining capacity in a dedicated rem variable decremented after each copy, and adds a null-pointer guard on the malloc return.
RemediationAI
The primary remediation is to update entr to a version that incorporates commit 2467fe0aa5f2b1b074110a9186ef51d35809c9a4 or later; this commit replaces the unsafe strlcpy-based pointer arithmetic with explicit strlen-based bounds enforcement followed by memcpy, and adds a null-pointer check on malloc. No specific tagged release version number incorporating this fix has been confirmed in the available data - users should check the entr project page at https://eradman.com/entrproject/ and the GitHub repository for a tagged release or distribution package that includes or supersedes this commit. Users of package managers such as Homebrew, apt, or pkg should monitor their respective repositories for updated entr packages. As a compensating control where patching is not immediately possible, operators should restrict the arguments passed to entr in automated scripts so that combined argument lengths remain well below ARG_MAX, and should avoid use of the slash-underscore substitution feature with file paths of unpredictable or attacker-influenced length. If entr is not required in a given environment, removing it eliminates the attack surface entirely with no functional trade-off.
Same weakness CWE-122 – Heap-based Buffer Overflow
View allSame technique Buffer Overflow
View allVendor StatusVendor
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-55623
GHSA-qpgw-rgmq-2367