CVEvulnerability
CVE-2026-50553
8.6 HIGH
Official page ↗
- Status
- Deferred
- Published
- 2026-09-04
- Last modified
- 2026-09-09
- Assigner
- [email protected]
- CVSS 4.0 ([email protected])
- 8.6 HIGH — 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
- Weaknesses
- CWE-20, CWE-22
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.
Related
References
- https://github.com/enchant97/note-mark/commit/67b7de04308a858ef27ceff87b514067b6d667e5 github.com
- https://github.com/enchant97/note-mark/releases/tag/v0.19.5 github.com
- https://github.com/enchant97/note-mark/security/advisories/GHSA-rqrh-8wpv-x7hh github.com
- https://github.com/enchant97/note-mark/security/advisories/GHSA-rqrh-8wpv-x7hh github.com