Skip to content

Asset directory traversal with some storage modules on Windows

High
NGPixel published GHSA-r363-73gj-6j25 Dec 4, 2021

Package

No package listed

Affected versions

<2.5.244

Patched versions

2.5.245

Description

Impact

Directory traversal outside of Wiki.js context is possible when a storage module with local asset cache fetching is enabled on a Windows host. A malicious user can potentially read any file on the file system by crafting a special URL that allows for directory traversal.

This is only possible on a Wiki.js server running on Windows, when a storage module implementing local asset cache (e.g Local File System or Git) is enabled and that no web application firewall solution (e.g. cloudflare) strips potentially malicious URLs.

Patches

Commit 414033d fixes this vulnerability by sanitizing the path before it is passed on to the storage module. The sanitization step removes any windows directory traversal sequences from the path.

Workarounds

Disable any storage module with local asset caching capabilities:

  • Local File System
  • Git

Thanks to @Braidon for reporting this vulnerability.

Severity

High

CVE ID

CVE-2021-43800

Weaknesses

No CWEs

Credits