{"vuln_id":"GHSA-2pj4-v76f-wjvx","aliases":["CVE-2026-62955","CVE-2026-30940","GHSA-c5c6-37vq-pjcq"],"description":"baserCMS: Path Traversal Bypass via realpath() in BcThemeFileService (CVE-2026-30940 Patch Bypass)","published_at":"2026-11-20T00:17:47Z","modified_at":"2026-11-20T00:30:07.775924Z","first_seen_at":"2026-11-21T19:15:19.296931Z","severity":"high","severity_source":"ghsa","cvss_score":7.2,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","cwe":["CWE-22"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-2pj4-v76f-wjvx"},"matched_alias":null,"items":[{"id":11086,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-2pj4-v76f-wjvx: baserCMS: Path Traversal Bypass via realpath() in BcThemeFileService (CVE-2026-30940 Patch Bypass)","summary":"baserCMS: Path Traversal Bypass via realpath() in BcThemeFileService (CVE-2026-30940 Patch Bypass)\n\n### Summary\n\nThe 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.\n\nAn 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.\n\n**This vulnerability was verified exploitable on baserCMS 5.2.3 (the \"patched\" version of CVE-2026-30940).**\n\n### Details\n\nThe 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):\n\n```php\npublic function getFullpath(string $theme, string $plugin, string $type, string $path)\n{\n    // ...build $baseDir and $fullPath from $theme, $type, $path...\n    $baseDir  = $viewPath . $type . DS;      // e.g. .../BcThemeSample/webroot/js/\n    $fullPath = $baseDir  . $path;           // e.g. .../webroot/js/../../../../webroot/\n\n    $resolvedBase = realpath($baseDir);\n    if ($resolvedBase !== false) {           // ← BYPASS: entire block skipped when dir absent\n        $resolvedBase = rtrim($resolvedBase, DS) . DS;\n        $targetDir = realpath(dirname($fullPath));\n        if ($targetDir === false) {\n            $targetDir = $this->normalizePath(dirname($fullPath));\n        }\n        if (!str_starts_with(rtrim($targetDir, DS) . DS, $resolvedBase)) {\n            throw new BcException(__d('baser_core', 'パスにテーマディレクトリ外への参照が含まれています。'));\n        }\n    }\n\n    return $fullPath;   // ← Returns unvalidated path when realpath returns false\n}\n```\n\n**Root cause — the bypass condition:**\n\n| `realpath($baseDir)` result | Behavior |\n|-----------------------------|----------|\n| Valid path string (dir **exists**) | Validation runs → `../` traversal **blocked** ✓ |\n| `false` (dir does **not** exist) | Validation **skipped entirely** → `../` traversal **allowed** ✗ |\n\n**Difference from CVE-2026-30940 (original bug):**\n\n| | CVE-2026-30940 (≤ 5.2.2) | This bypass (5.2.3) |\n|--|--|--|\n| Validation | None at all | `realpath()` check — but conditional |\n| `type` needed | Any valid type (`layout`, `cell`, …) | Must map to a **non-existent** subdirectory |\n| `path` blocked | Never | Only when target dir already exists |\n| Root cause | Missing validation | `if ($resolvedBase !== false)` skips fal\n\nAffected: Packagist:baserproject/baser-core\n\nFixed in: 5.3.0\n\nReferences:\nhttps://github.com/baserproject/basercms/security/advisories/GHSA-2pj4-v76f-wjvx\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-62955\nhttps://github.com/baserproject/basercms/commit/464227b8770704076ee6eddd4bd464c184786eca\nhttps://github.com/baserproject/basercms/commit/c650017acf5dfbfd15eb2f3eda07967bcb002be2\nhttps://github.com/baserproject/bc-theme-file/commit/a8f90096f13eca576a87cb25aa02e8f54642af7e\nhttps://github.com/baserproject/basercms\nhttps://github.com/baserproject/basercms/releases/tag/5.3.0","url":"https://osv.dev/vulnerability/GHSA-2pj4-v76f-wjvx","published_at":"2026-11-20T00:17:47Z","updated_at":"2026-11-20T00:30:07.775924Z","fetched_at":"2026-11-21T19:15:55.946420Z","severity":"high","cvss_score":7.2,"epss":0.01091,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"baserproject/baser-core","vuln_id":"CVE-2026-62955","vuln_ids":["CVE-2026-30940","CVE-2026-62955","GHSA-2PJ4-V76F-WJVX","GHSA-C5C6-37VQ-PJCQ"],"tags":["osv","packagist","fix-available"],"cluster_id":2070,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11086","html":"https://vulnwatch.ve1ve2.com/item/11086"}},{"id":2324,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-2pj4-v76f-wjvx / CVE-2026-62955: baserCMS: Path Traversal Bypass via realpath() in BcThemeFileService (CVE-2026-30940 Patch Bypass)","summary":"baserCMS: Path Traversal Bypass via realpath() in BcThemeFileService (CVE-2026-30940 Patch Bypass)\n\n### Summary\n\nThe 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.\n\nAn 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.\n\n**This vulnerability was verified exploitable on baserCMS 5.2.3 (the \"patched\" version of CVE-2026-30940).**\n\n### Details\n\nThe 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):\n\n```php\npublic function getFullpath(string $theme, string $plugin, string $type, string $path)\n{\n    // ...build $baseDir and $fullPath from $theme, $type, $path...\n    $baseDir  = $viewPath . $type . DS;      // e.g. .../BcThemeSample/webroot/js/\n    $fullPath = $baseDir  . $path;           // e.g. .../webroot/js/../../../../webroot/\n\n    $resolvedBase = realpath($baseDir);\n    if ($resolvedBase !== false) {           // ← BYPASS: entire block skipped when dir absent\n        $resolvedBase = rtrim($resolvedBase, DS) . DS;\n        $targetDir = realpath(dirname($fullPath));\n        if ($targetDir === false) {\n            $targetDir = $this->normalizePath(dirname($fullPath));\n        }\n        if (!str_starts_with(rtrim($targetDir, DS) . DS, $resolvedBase)) {\n            throw new BcException(__d('baser_core', 'パスにテーマディレクトリ外への参照が含まれています。'));\n        }\n    }\n\n    return $fullPath;   // ← Returns unvalidated path when realpath returns false\n}\n```\n\n**Root cause — the bypass condition:**\n\n| `realpath($baseDir)` result | Behavior |\n|-----------------------------|----------|\n| Valid path string (dir **exists**) | Validation runs → `../` traversal **blocked** ✓ |\n| `false` (dir does **not** exist) | Validation **skipped entirely** → `../` traversal **allowed** ✗ |\n\n**Difference from CVE-2026-30940 (original bug):**\n\n| | CVE-2026-30940 (≤ 5.2.2) | This bypass (5.2.3) |\n|--|--|--|\n| Validation | None at all | `realpath()` check — but conditional |\n| `type` needed | Any valid type (`layout`, `cell`, …) | Must map to a **non-existent** subdirectory |\n| `path` blocked | Never | Only when target dir already exists |\n| Root cause | Missing validation | `if ($resolvedBase !== false)` skips fal\n\nAffected packages: composer:baserproject/baser-core\nPatched: baserproject/baser-core 5.3.0","url":"https://github.com/advisories/GHSA-2pj4-v76f-wjvx","published_at":"2026-11-20T00:17:47Z","updated_at":"2026-11-20T00:17:48Z","fetched_at":"2026-11-21T19:15:18.416751Z","severity":"high","cvss_score":7.2,"epss":0.01091,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"baserproject/baser-core","vuln_id":"CVE-2026-62955","vuln_ids":["CVE-2026-30940","CVE-2026-62955","GHSA-2PJ4-V76F-WJVX","GHSA-C5C6-37VQ-PJCQ"],"tags":["ghsa","composer","CWE-22"],"cluster_id":2070,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2324","html":"https://vulnwatch.ve1ve2.com/item/2324"}},{"id":9288,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-62955: baserCMS is a website development framework. From 5.2.3 until 5.3.0, BcThemeFileService::getFullpath() in plugins/bc-theme-file/src/Service/BcThemeFileService.…","summary":"baserCMS is a website development framework. From 5.2.3 until 5.3.0, BcThemeFileService::getFullpath() in plugins/bc-theme-file/src/Service/BcThemeFileService.php skips its path containment check when realpath() fails for a nonexistent theme subdirectory selected by the type parameter. An authenticated administrator can supply a traversal path through the theme-file API to access locations outside the theme directory. The bypass of the CVE-2026-30940 fix can permit file writes, overwrites or deletion within the PHP process permissions and, where executable PHP can be written, remote code execution. This issue is fixed in 5.3.0.\n\nReferences:\nhttps://github.com/baserproject/basercms/commit/464227b8770704076ee6eddd4bd464c184786eca\nhttps://github.com/baserproject/basercms/commit/c650017acf5dfbfd15eb2f3eda07967bcb002be2\nhttps://github.com/baserproject/basercms/releases/tag/5.3.0\nhttps://github.com/baserproject/basercms/security/advisories/GHSA-2pj4-v76f-wjvx\nhttps://github.com/baserproject/bc-theme-file/commit/a8f90096f13eca576a87cb25aa02e8f54642af7e","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62955","published_at":"2026-11-19T21:18:03.203000Z","updated_at":"2026-11-19T21:18:03.407000Z","fetched_at":"2026-11-21T19:15:31.484899Z","severity":"high","cvss_score":7.2,"epss":0.01091,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":null,"vuln_id":"CVE-2026-62955","vuln_ids":["CVE-2026-30940","CVE-2026-62955","GHSA-2PJ4-V76F-WJVX","GHSA-C5C6-37VQ-PJCQ"],"tags":["CWE-22"],"cluster_id":2071,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/9288","html":"https://vulnwatch.ve1ve2.com/item/9288"}}]}