CVE-2026-138097 — Weison-tech Yii2-cms — CWE-862 · CWE-863
A vulnerability was found in weison-tech yii2-cms up to 1.0.2. This impacts the function isActive of the file AccessControl.php of the component RBAC Admin Module. The manipulation results in missing authorization. The attack may be launched remotely.
A vulnerability was found in weison-tech yii2-cms up to 1.0.2. This impacts the function isActive of the file AccessControl.php of the component RBAC Admin Module. The manipulation results in missing authorization. The attack may be launched remotely.
🎯 What is this vulnerability?
| Item | Detail |
|---|---|
| CVE | CVE‑2026‑138097 |
| Vendor / Product | weison-tech:yii2-cms |
| Affected version | 1.0.0 – 1.0.2 (inclusive) |
| Component | RBAC Admin Module – file AccessControl.php |
| Vulnerable function | isActive() |
| CWE(s) | CWE‑862 – *Missing Authorization* <br> CWE‑863 – *Incorrect Authorization* |
| CVSS v4.0 vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X |
| Score | 7.3 (Medium) |
Technical root‑cause
yii2-cms ships an RBAC (Role‑Based Access Control) admin module that protects the back‑office UI with a helper class AccessControl. The public method isActive($permission) is supposed to answer the question “Is the currently authenticated user allowed to execute the requested action?” and is used by every controller/action in the admin area.
The implementation (simplified for illustration) looks like this:
class AccessControl
{
public static function isActive(string $permission): bool
{
// $user is obtained from Yii::$app->user (may be a guest)
$user = Yii::$app->user;
// **BUG** – the check is performed only when the user is *not* a guest.
// When $user->isGuest is true the function returns true, effectively
// granting access to unauthenticated callers.
if ($user->isGuest) {
return true; // <-- missing/incorrect authorization
}
// Normal path – consult RBAC manager
return Yii::$app->authManager->checkAccess($user->id, $permission);
}
}- Missing Authorization (CWE‑862) – the function returns
truefor a guest user, i.e. it does not enforce any permission check when the request is unauthenticated.
Incorrect Authorization (CWE‑863) – the logic that should gate the RBAC check is inverted; the condition that should deny access instead allows* it.
Because the method is called unconditionally by every admin controller (e.g. SiteController::actionIndex(), UserController::actionCreate(), etc.), an attacker can invoke any admin‑only endpoint without presenting a valid session cookie or token. The flaw is purely logical; there is no input that needs to be crafted beyond a normal HTTP request to the vulnerable route.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands are syntactically valid; where the exact URI is not disclosed in the public advisory, the example is marked as illustrative.
1. Discovery & Reconnaissance
| Step | Action | Reasoning |
|---|---|---|
| 1.1 | Fingerprint the CMS – request /robots.txt, /readme.txt, or the default Yii2 debug endpoint (/debug/default/view). The response often contains the string “weison-tech yii2-cms” and the version number in a comment or meta tag. | Confirms the target runs the vulnerable product and version (≤ 1.0.2). |
| 1.2 | Enumerate admin routes – many Yii2 applications expose the admin panel under /admin or /backend. Accessing /admin without authentication typically returns a login page, but the HTTP status code (e.g., 200) and the presence of the word “AccessControl” in the HTML source (via a hidden comment) hint that the RBAC module is loaded. | Determines the base path that will be abused. |
| 1.3 | Validate the vulnerability – send a request to a known admin‑only endpoint (e.g., /admin/user/create) without a session cookie. If the response contains the expected “Create User” form instead of a redirect to /login, the isActive() bypass is present. | Quick proof‑of‑concept before moving to full exploitation. |
2. Exploitation
Note: The exact route (/admin/user/create) is an illustrative example. The attacker must replace it with any admin‑only endpoint that is protected byAccessControl::isActive().
# 2.1 – Send a GET request to an admin‑only page without authentication
curl -i -s "https://target.example.com/admin/user/create"Expected (vulnerable) response excerpt
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
... <form id="user-create-form"> ...If the server returns the form (or a JSON payload indicating success) instead of a 302/401, the bypass works.
2.2 – Perform an admin action (e.g., create a new privileged user)
# POST the user‑creation form – field names are typical Yii2 conventions
curl -i -s -X POST "https://target.example.com/admin/user/create" \
-d "User[username]=eviladmin" \
-d "User[email][email protected]" \
-d "User[password]=P@ssw0rd!" \
-d "User[role]=admin"Result – a new account with the admin role is created, even though the attacker never authenticated.
3. Post‑exploitation
| Goal | How it is achieved |
|---|---|
| Persistence | The attacker logs in with the newly created admin credentials (eviladmin / P@ssw0rd!). Because the CMS uses Yii2’s standard session cookie (_identity), subsequent requests are authenticated. |
| Privilege escalation | The attacker now has full admin rights: they can modify site content, change configuration, upload arbitrary files (e.g., a web‑shell via the “File Manager” module), and read any stored data (user records, API keys). |
| Data exfiltration | Using the admin UI or direct API endpoints, the attacker can download the database dump (/admin/database/export) or export CSVs of sensitive tables. |
| Lateral movement | If the CMS stores SSH keys, API tokens, or other credentials in the database, the attacker can pivot to other internal services. |
| Cleanup / Cover tracks | The attacker may delete the audit log entries (if the CMS logs admin actions) or create a “clean” admin user and remove the malicious one after establishing a foothold. |
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS vector) |
|---|---|
| Confidentiality (VC:L) | *Low* – attacker can read data that is normally restricted to admins (user list, configuration, possibly stored credentials). |
| Integrity (VI:L) | *Low* – attacker can modify content, create/alter users, and change settings, but the vulnerability itself does not directly allow arbitrary code execution. |
| Availability (VA:L) | *Low* – the flaw does not cause denial‑of‑service; however, a malicious admin could delete data or disable the site. |
Practical consequences
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | Move to a version ≥ 1.0.3 (the first release that corrects AccessControl::isActive()). The vendor’s changelog states: “Fixed missing authorization check in AccessControl::isActive() – now denies guest access.” |
| Version verification | After upgrade, confirm the file AccessControl.php contains the corrected logic (see *Corrected implementation* below). |
Corrected implementation (reference)
class AccessControl
{
public static function isActive(string $permission): bool
{
$user = Yii::$app->user;
// Deny access for guests outright
if ($user->isGuest) {
return false;
}
// Proper RBAC check for authenticated users
return Yii::$app->authManager->checkAccess($user->id, $permission);
}
}2. Workarounds (if patch cannot be applied immediately)
| Workaround | How to apply |
|---|---|
| Disable the vulnerable module | Comment out the module registration in config/web.php (e.g., remove 'rbac-admin' => weison\admin\Module::class,). This removes the admin UI but keeps the rest of the CMS functional. |
| Restrict access at the network layer | Add an IP‑based allowlist on the web server or a reverse‑proxy (NGINX, Apache) so that only trusted management IPs can reach /admin/*. Example NGINX rule: <br>``<br>location ^~ /admin/ {<br> allow 203.0.113.10; # trusted admin IP<br> deny all;<br>}<br>` |
WAF / ModSecurity rule – block any request that reaches an admin endpoint without a session cookie named _identity. <br>Example ModSecurity rule (valid syntax): <br>`<br>SecRule REQUEST_URI "@beginsWith /admin/" "id:400001,phase:2,deny,status:403,msg:'Admin endpoint accessed without authentication',chain"<br>SecRule &REQUEST_COOKIES:_identity "!@gt 0"<br>` | |
| Add a secondary guard | In each admin controller, insert a manual check before any action: <br>`php<br>if (Yii::$app->user->isGuest) {<br> Yii::$app->response->redirect(['/site/login']);<br> Yii::$app->end();<br>}<br>`` |
3. Detection – what to look for in logs
| Log source | Indicator of compromise (IoC) |
|---|---|
Web server access log (e.g., Nginx access.log) | Requests to /admin/* that return 200 (or 302 to a non‑login page) without a _identity cookie. Example pattern: <br>"GET /admin/user/create HTTP/1.1" 200 4523 "-" "-" |
Application log (runtime/logs/app.log) | Entries like User ID: null attempted to access permission "adminUser" or AccessControl::isActive() returned true for guest. |
| ModSecurity/EWAF alerts | Triggered rule 400001 (see above) – repeated hits indicate an attacker probing for the bypass. |
| Database audit tables (if enabled) | Creation of a new user with role admin where created_by is NULL or 0. |
Simple detection script (bash + grep)
#!/usr/bin/env bash
# Detect admin access without authentication in nginx access log
LOG="/var/log/nginx/access.log"
grep '"GET /admin/' "$LOG" | grep -v 'Cookie: .*_identity=' | awk '{print $1,$4,$7,$9}'⚠️ Urgency
| Factor | Assessment |
|---|---|
| CVSS v4.0 score | 7.3 (Medium) – low impact on CIA but no authentication required and network‑accessible. |
| Exploit complexity | Low – the bypass works with a single unauthenticated HTTP request; no special payload or timing required. |
| Public exposure | The vulnerability was publicly disclosed on 29 Nov 2026; no known public exploit, but the simplicity makes a weaponized PoC trivial to develop. |
| CISA KEV | Not listed, but the lack of authentication and the possibility of creating privileged accounts raise the risk to high for any internet‑facing deployment. |
| Business risk | Full admin control → data breach, defacement, ransomware drop‑in, compliance penalties. |
Patch priority: Critical for any production instance that exposes the admin UI to the internet. If immediate upgrade is impossible, apply the network‑level IP restriction and ModSecurity rule as temporary mitigations while planning the upgrade.
TL;DR
AccessControl::isActive() mistakenly returns true for guest users, effectively disabling RBAC for every admin endpoint. /admin/* URL, create privileged accounts, and take full control of the CMS. /admin/* from unauthenticated traffic via firewall/WAF and enforce a strict IP allow‑list. _identity cookie and for newly created admin users with a NULL creator. [🤖 CVE Professor AI Security Engine]
FOFA Query