CVE-2026-77814
The vulnerability in CVE-2026-77814 stems from a path containment check using string prefix matching without directory boundary enforcement. The is_path_trusted function validates whether a requested path begins with an allowed parent directory using path.startswith(parent_path), but this string operation fails when the allowed path is a prefix of a sibling directory name. When /data/images is whitelisted, a request for /data/images_private/secret.txt satisfies the check because the string 'images_private' literally begins with 'images' — a subtlety that escapes casual code review but collapses under adversarial inputs. The dangerous asymmetry here is that access control activates precisely in network-exposed deployments (when share, ngrok, listen, or server_name flags are set), which is exactly where an attacker can reach the endpoint. Meanwhile, standalone instances with no network exposure don't enable this check at all — they serve files without restriction regardless of this vulnerability. So the os.sep fix addresses the flaw in the one scenario where it matters, while the broader architecture leaves standalone users unprotected from local file access by design. The CVSS 7.5 reflects the broken lock on a door that only exists when exposed to the street, but says nothing about the larger population running standalone who accept untrusted file inputs with no access control layer at all. Verify the fix by testing path variations: /data/images_private, /data/images../, /data/images (null byte), and Unicode confusables. Beyond this specific fix, audit other path-handling functions in the codebase for the same substring-matching pattern — this is a known mutation of classic path traversal that has recurred across Apache, PHP, Nextcloud, and GitLab. The intuitive check (does this path start with the allowed prefix?) feels equivalent to the secure one (does this path live within the allowed directory?) but isn't. Consider whether the codebase needs a path containment utility that enforces directory boundary semantics by construction, eliminating the cognitive step where this bug originated.
Reviewed through automated stages and approved by a human before publication.