/

CVE-2026-62955

Severity:

HIGH RISK

(7.2)

Path Traversal (CWE-22) in baserCMS Theme File API

CVE-2026-62955

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized file access and modification; potential remote code execution

Severity:

HIGH RISK

(7.2)

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

baserCMS has a path traversal flaw in its theme-file API: when a selected theme subdirectory does not exist, a failed realpath() can cause the path containment check to be skipped. An authenticated administrator may exploit this behavior to access paths outside the theme directory, potentially allowing file changes within the PHP process's permissions and, in some circumstances, remote code execution.

Affected context

The issue is in BcThemeFileService::getFullpath() in the theme-file plugin. It affects baserCMS releases from 5.2.3 up to, but not including, 5.3.0 when a theme-file API request selects a nonexistent theme subdirectory and the resulting path is not contained within the intended theme directory.

Exploit preconditions

  • Attack surface: The baserCMS theme-file API
  • Required access: An authenticated administrator able to submit requests to the API
  • Trigger point: Path resolution for a theme-file operation using a type value that selects a nonexistent subdirectory
  • Why exploitation is possible: If realpath() fails, the containment check may be skipped, allowing a traversal path to resolve outside the theme directory

Why this happens

The path validation logic depends on successful canonicalization with realpath(). When canonicalization fails for a nonexistent subdirectory, the containment check is bypassed rather than rejecting the path. This is a path traversal weakness mapped to CWE-22, where input used to construct a file path is not reliably constrained to its intended directory.

Potential impact

  • An attacker may write, overwrite, or delete files accessible to the PHP process outside the theme directory.
  • Application files or configuration may be altered, depending on filesystem permissions.
  • Remote code execution could occur if the attacker can place executable PHP in a location where it is served or run.

General mitigation guidance

Defensive patterns for this class of issue include:

  • Rejecting paths when canonicalization fails, rather than skipping containment checks.
  • Constraining file operations to an allowlisted set of names and directories.
  • Validating resolved paths against a trusted base directory for every operation.
  • Avoiding reliance on user-controlled path components, including values such as type.
  • Running the PHP process with only the filesystem permissions required for normal operation.

How teams detect issues like this

  • Use static analysis to identify file operations whose paths incorporate request-controlled values and whose containment checks depend on successful canonicalization.
  • Review error paths around realpath() and confirm that failed resolution results in rejection.
  • Check that read, write, overwrite, and delete operations all enforce the same trusted-directory boundary.
  • Apply code-review or CI policies that flag filesystem paths built from API input without robust allowlisting and containment validation.

Sources

SourceLink
github.comgithub.com/baserproject/basercms/commit/464227b8770704076ee6eddd4bd464c184786eca
github.comgithub.com/baserproject/basercms/commit/c650017acf5dfbfd15eb2f3eda07967bcb002be2
github.comgithub.com/baserproject/basercms/releases/tag/5.3.0
github.comgithub.com/baserproject/basercms/security/advisories/GHSA-2pj4-v76f-wjvx
github.comgithub.com/baserproject/bc-theme-file/commit/a8f90096f13eca576a87cb25aa02e8f54642af7e

Frequently asked

questions

It can be triggered through the theme-file API, but the described issue requires an authenticated administrator with access to that API.

An attacker needs administrator access sufficient to submit theme-file API requests.

Reject unresolved paths and verify that every resolved path remains inside a trusted base directory before performing file operations.

Avoid trusting request-controlled path components, use allowlists for permitted files and directories, and ensure filesystem operations run with least privilege.

Find out what's already
exploitable in your codebase.