DEV Community

CVE Reports
CVE Reports

Posted on Originally published at cvereports.com

CVE-2026-62955: CVE-2026-62955: Authenticated Path Traversal and Remote Code Execution via realpath() Bypass in baserCMS…

CVE-2026-62955: Authenticated Path Traversal and Remote Code Execution via realpath() Bypass in baserCMS BcThemeFileService

Vulnerability ID: CVE-2026-62955
CVSS Score: 7.2
Published: 2026-11-20

CVE-2026-62955 is an authenticated path traversal vulnerability in baserCMS affecting versions 5.2.3 up to, but not including, 5.3.0. The flaw resides in the BcThemeFileService::getFullpath() method within the bc-theme-file plugin and represents an incomplete remediation of CVE-2026-30940. Because the path containment check relies on PHP's realpath() returning a non-false value, supplying a nonexistent theme subdirectory causes the verification guard to be skipped entirely. An authenticated administrator can exploit this flaw to read, write, overwrite, or delete arbitrary files within the permissions of the PHP process, leading to remote code execution when executable PHP files are written to the webroot.

TL;DR

An incomplete patch for CVE-2026-30940 in baserCMS (versions 5.2.3 to < 5.3.0) allows authenticated administrators to bypass directory containment checks in BcThemeFileService::getFullpath(). By requesting an asset or template subdirectory that does not exist on disk, realpath() returns false and skips path validation, enabling arbitrary file operations and remote code execution.


⚠️ Exploit Status: POC

Technical Details

  • Vulnerability Type: Path Traversal / Protection Mechanism Failure (CWE-22, CWE-693)
  • Affected Component: BcThemeFileService::getFullpath() (plugins/bc-theme-file)
  • Attack Vector: Network (Authenticated Admin Web UI / Admin REST API)
  • CVSS v3.1 Score: 7.2 HIGH (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H)
  • Security Impact: Arbitrary File Read/Write/Delete and Remote Code Execution (RCE)
  • Exploit Status: Public Proof-of-Concept (PoC) Available
  • CISA KEV Status: Not Listed
  • Fixed Version: baserCMS 5.3.0

Affected Systems

  • baserproject/basercms (>= 5.2.3, < 5.3.0)
  • baserproject/bc-theme-file (>= 5.2.3, < 5.3.0)
  • basercms: >= 5.2.3, < 5.3.0 (Fixed in: 5.3.0)
  • bc-theme-file: >= 5.2.3, < 5.3.0 (Fixed in: 5.3.0)

Code Analysis

Commit: 464227b

Backport of 5.2.x security patches addressing GHSA-2pj4-v76f-wjvx and related advisories.

Commit: c650017

Security merge to main branch for baserCMS 5.3.0 release.

Commit: a8f9009

Fix in bc-theme-file repository adding template type allowlisting, unconditional path normalization fallback, and assertWithinThemeDir() checks.

Exploit Details

  • GitHub: Public research repository containing differential verification containers, poc/poc.py, and exploit/exploit.py demonstrating the realpath() bypass in baserCMS 5.2.3.

Mitigation Strategies

  • Upgrade baserCMS and the bc-theme-file plugin to version 5.3.0 or later to enforce unconditional path normalization, template type allowlisting, and sink-level directory containment assertions.
  • Restrict access to theme file management endpoints (/baser/admin/bc-theme-file/* and /baser/api/admin/bc-theme-file/*) via baserCMS permission management.
  • Disable the baserCMS Core Admin API by setting USE_CORE_ADMIN_API=false in config/.env if external administrative API calls are not utilized.
  • Apply principle-of-least-privilege filesystem permissions so the PHP worker process cannot modify core application source files, configuration files, or webroot entry points.

Remediation Steps:

  1. Back up the baserCMS database, configuration files, and custom theme directories.
  2. Update composer.json to require baserproject/basercms >= 5.3.0 and run 'composer update'.
  3. Execute 'bin/cake migrations migrate' and 'bin/cake cache clear_all' to finalize the upgrade.
  4. Verify that requests to theme-file endpoints containing '../' or invalid 'type' parameters are rejected with a BcException.
  5. Auditplugins/ and webroot/ directories for unauthorized PHP files or modifications that may have occurred prior to patching.

References


Read the full report for CVE-2026-62955 on our website for more details including interactive diagrams and full exploit analysis.

Top comments (0)