ZeroHour

CVE-2026-50553

niche

Path Traversal in Note Mark slug validation enables root file write on export

CVSS 4.0
8.6 high
EPSS
<1%p31
Published
()
Modified
AI analysis

Note Mark, an open-source self-hosted note-taking application, improperly validates book and note slugs prior to version 0.19.5 because its validation regex is tested unanchored, so any slug merely containing an allowed substring — including path-traversal sequences such as ../../ — is accepted and stored verbatim. When an administrator runs the 'note-mark migrate export' or 'note-mark migrate export-v1' CLI commands, these unsanitized slugs are joined directly into the output paths, so note files can be created outside the intended export directory. An attacker with low-privilege access to a Note Mark instance can plant or rename notes with malicious slugs and, when a privileged user later performs an export, achieve arbitrary directory creation and file write — commonly as root in default Docker or bare-metal admin usage — which could allow overwriting or planting files for further impact. Operators running any Note Mark version before 0.19.5 who perform exports are affected. There is no known exploitation in the wild, no public proof-of-concept, and EPSS currently estimates only a 0.4% probability of exploitation within 30 days.

What to do: Upgrade Note Mark to version 0.19.5 or later. Until upgraded, avoid running export commands as root (use a dedicated low-privilege user), review book and note slugs for '../' or path characters before running migrate export or export-v1, and check for unexpected files or directories created outside past export directories.

Affected
Note Mark (open-source project) Note Markall versions prior to 0.19.5 (fixed in 0.19.5)
Estimated exposure
nichelikely low thousands of self-hosted instances at most (no public install statistics available) — No public installation counts exist, so this estimate reflects the small self-hosted user base typical of this niche open-source note-taking project, further narrowed because exploitation requires both a low-privilege account on the…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

Note Mark is an open-source note-taking application. Prior to version 0.19.5, Note Mark validates book and note slug values with the OpenAPI/huma tag pattern:"[a-z0-9-]+". huma compiles this with regexp.MustCompile(s.Pattern) and tests it with patternRe.MatchString(str), an UNANCHORED match. Because the pattern is not anchored (^...$), any string that merely CONTAINS one [a-z0-9-] substring passes validation. A slug such as ../../../../../../tmp/escape is accepted and stored verbatim. The data-export CLI commands (note-mark migrate export and note-mark migrate export-v1) join these unsanitized slugs straight into the output path with path.Join / filepath.Join, then os.MkdirAll the directory and os.Create the note file. path.Join resolves the ../ segments, so the note content file is written OUTSIDE the configured export directory. The export process commonly runs as root (default in Docker / bare-metal admin usage), so this is a root-privilege arbitrary directory create + file write. This issue has been patched in version 0.19.5.

Weakness
CWE-20, CWE-22
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/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

In the news

No ingested article mentions this CVE yet.