Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/enchant97/note-mark/backend
  4. ›
  5. CVE-2026-50553

CVE-2026-50553: Note Mark: Path traversal via unsanitized book/note slug in migrate export (sibling of GHSA-g49p)

July 9, 2026

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 is the unguarded sibling of GHSA-g49p-4qxj-88v3 (CVE class CWE-22 in the same export sinks). That fix added filepath.Base(asset.Name) to sanitize the asset filename, but the adjacent path components book.Slug and note.Slug — used in the very same path.Join calls in the same two export functions — were left raw, and their input-side pattern guard is bypassable as shown above.

References

  • github.com/advisories/GHSA-rqrh-8wpv-x7hh
  • github.com/enchant97/note-mark/commit/67b7de04308a858ef27ceff87b514067b6d667e5
  • github.com/enchant97/note-mark/security/advisories/GHSA-rqrh-8wpv-x7hh
  • nvd.nist.gov/vuln/detail/CVE-2026-50553

Code Behaviors & Features

Detect and mitigate CVE-2026-50553 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.0.0-20260601210719-67b7de04308a

Fixed versions

  • 0.0.0-20260601210719-67b7de04308a

Solution

Upgrade to version 0.0.0-20260601210719-67b7de04308a or above.

Impact 8 HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation
  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

go/github.com/enchant97/note-mark/backend/CVE-2026-50553.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:19 +0000.