/

CVE-2026-45233

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in HTMLy CMS Autosave Logic

CVE-2026-45233

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Relocation and Content Tampering

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

HTMLy CMS up to version 3.1.1 contains a path traversal flaw in the admin autosave endpoint that lets low-privileged authenticated users move arbitrary files on the server.

By injecting directory traversal sequences into the oldfile parameter, an attacker can influence file existence checks and rename operations, causing unintended relocation of any file writable by the web server into attacker-controlled draft locations.

Affected context

This vulnerability arises in HTMLy CMS installations where authenticated users can access the admin autosave functionality.

The issue is present when user-supplied filenames from the oldfile parameter are used directly in filesystem operations without path normalization, sanitization, or enforcement of a safe base directory.

It typically impacts environments where the web server process has write access to content, configuration, or other application files under the CMS directory tree.

Exploit preconditions

  • Attack surface: HTTP(S) request to the admin autosave endpoint (admin.php) in HTMLy CMS.
  • Required access: Low-privileged authenticated access to the CMS dashboard or autosave feature.
  • Trigger point: Submission of an autosave request containing crafted oldfile values with directory traversal sequences (e.g., ../ patterns).
  • Why exploitation is possible: The application passes the oldfile parameter directly to file_exists() and rename() without canonicalizing the path or enforcing directory boundaries, allowing attacker-controlled paths to influence where files are located on disk.

Why this happens

The core bug is an improper limitation of the path used for filesystem operations, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

HTMLy CMS relies on user-controlled input (oldfile) to build filesystem paths for autosave and draft handling, but it does not normalize, validate, or restrict those paths to a dedicated content directory.

Consequently, directory traversal sequences are honored by the underlying operating system APIs, enabling attackers to target arbitrary writable files and relocate them to locations under their control.

Potential impact

  • Files writable by the web server can be relocated into attacker-chosen draft or content directories.
  • Application content may be overwritten, reordered, or made unavailable due to unintended file moves.
  • Draft areas controlled by the attacker can be populated with sensitive or configuration files that might later be exposed or manipulated.
  • Integrity of posts, media, or auxiliary scripts can be degraded, potentially aiding further exploitation via content spoofing or confusion.

General mitigation guidance

Effective mitigation focuses on treating all filesystem paths derived from user input as untrusted and constraining them to well-defined directories.

Common patterns include:

  • Performing path canonicalization and rejecting any path containing traversal components or resolving outside the intended content root.
  • Maintaining a whitelist of valid filenames or IDs and mapping them to server-side paths rather than accepting raw paths from the client.
  • Implementing a dedicated storage area for autosave and draft files, with strict checks to ensure operations never cross directory boundaries.
  • Running the web server and CMS code with least-privilege filesystem permissions so that only necessary content files are writable.
  • Centralizing file-handling logic behind a safe abstraction that enforces directory constraints and normalizes paths.

How teams detect issues like this

Detection generally relies on examining how the application constructs paths from request parameters and applies filesystem functions.

Security teams can:

  • Use static analysis rules to flag direct use of user input in functions such as file_exists(), rename(), unlink(), or similar filesystem APIs without prior validation.
  • Perform code reviews focusing on areas that accept filename or path parameters, looking for missing canonicalization and boundary checks.
  • Define secure coding policies that require all path-based operations to pass through vetted helper functions enforcing restricted directories.
  • Employ automated application security testing (DAST/IAST) tools configured to send directory traversal payloads to endpoints exposing file-related parameters, observing unexpected file moves or access patterns.

Sources

SourceLink
gist.github.comgist.github.com/mrgr4yhat/c4df971eafa272ac8c86c15e2829b7fe
vulncheck.comvulncheck.com/advisories/htmly-cms-path-traversal-via-oldfile-parameter-in-autosave

Frequently asked

questions

Exploitability is limited to environments where attackers hold low-privileged authenticated accounts, but within that scope it can be significant if the web server can write to sensitive files under the application directory.

The attacker must be an authenticated user with access to the HTMLy CMS admin autosave endpoint, even at low privilege, since the vulnerable logic is not exposed to anonymous visitors.

The most robust fix is to stop using raw client-supplied paths, instead mapping trusted identifiers to server-side paths, and enforcing canonicalization plus directory boundary checks so no operation can escape the designated content root.

Developers should adopt a consistent file-handling abstraction that validates and normalizes all paths, forbid direct use of request parameters in filesystem APIs, apply least-privilege filesystem permissions, and include path traversal checks in both code review standards and automated security testing.

Find out what's already
exploitable in your codebase.