Home/Research/Post

GHSA-2pj4-v76f-wjvx: baserCMS: Path Traversal Bypass via realpath() in BcThemeFileService (CVE-2026-30940 Patch Bypass)

  • Severity: HIGH
  • CVE: CVE-2026-62955
  • Ecosystems: composer
  • Packages: baserproject/baser-core

### Summary

The security patch introduced in baserCMS 5.2.3 to address CVE-2026-30940 / [GHSA-c5c6-37vq-pjcq](https://github.com/baserproject/basercms/security/advisories/GHSA-c5c6-37vq-pjcq) is **incomplete**. The patch added a `realpath()`-based directory traversal check in `BcThemeFileService::getFullpath()`, but the check is **entirely skipped** when `realpath($baseDir)` returns `false` — which occurs whenever the target subdirectory does not physically exist on disk.

An authenticated administrator can bypass the patch by supplying a `type` value (e.g., `js`) that maps to a non-existent directory in the theme. The absence of the directory causes `realpath()` to return `false`, the validation block is skipped, and the raw `path` parameter containing `../` sequences is returned unvalidated. This enables arbitrary file write and remote code execution (RCE) — the exact same impact as the original CVE.

**This vulnerability was verified exploitable on baserCMS 5.2.3 (the “patched” version of CVE-2026-30940).**

### Details

The vulnerability exists in `BcThemeFileService::getFullpath()` at [`plugins/bc-theme-file/src/Service/BcThemeFileService.php` lines 70–82](https://github.com/baserproject/basercms/blob/5.2.x/plugins/bc-theme-file/src/Service/BcThemeFileService.php#L70):

“`php
public function getFullpath(string $theme, string $plugin, string $type, string $path)
{
// …build $baseDir and $fullPath from $theme, $type, $path…
$baseDir = $viewPath . $type . DS; // e.g…

Source: GitHub Security Advisories · 2026-11-20