logo svg
logo

October 11, 2025

Updated: November 4, 2026

SVX Portal 2.7A: Admin Settings Overwrite via CSRF (CVE-2025-63724)

Admin settings overwrite via CSRF in SVX Portal 2.7A (CVE-2025-63724)

Mohammed Khalil

Mohammed Khalil

Featured Image

Product: SVXportal (source tree: SVXportal-master)

Affected file: admin/update_setings.php

Affected version: SVX Portal 2.7A. Identifier: CVE-2025-63724 (published on NVD on 14 November 2025).

Affected lines (from the upstream admin/update_setings.php):

mysqli_set_charset($link,"utf8");

if($_SESSION['is_admin'] >0 && $_SESSION['loginid'] >0 ){
    ...
    foreach ($_POST as $define => $value ) {
        $define = $link->real_escape_string($define);
        $value = $link->real_escape_string($value);
        $link->query("UPDATE `Settings` SET `value` = '$value' WHERE `Settings`.`Define` = '$define'; ");
    }
    ...
}

Technical clarification (updated 3 November 2026): CVE-2025-63724 is recorded as SQL injection (CWE-89), but the upstream admin/update_setings.php does not let request data change the structure of the SQL statement. The endpoint runs only when the session has is_admin and loginid set. It sets the connection charset to utf8 with mysqli_set_charset, escapes every POST field name and value with real_escape_string, and places both inside single-quoted string literals, and mysqli::query runs one statement per call. What the code does allow is for an authenticated admin, or a forged cross-site request sent from an admin's browser, to overwrite the value of any existing row in the Settings table by using its Define name as a POST field, because there is no allowlist of editable settings and no CSRF token. The sections below have been corrected to describe that behaviour; the CVE identifier and its published CVSS score are unchanged. As of 3 November 2026, the file in the public upstream repository has not changed since May 2020. For how real SQL injection differs from this behavior, see our SQL injection guide.

Overview

This is an admin-only arbitrary settings overwrite, one of the common web vulnerability classes that come from trusting client-supplied field names. The endpoint treats every POST field name as a setting name and writes the field value into that setting. Both are escaped with real_escape_string on a utf8 connection and quoted, so they stay data rather than SQL. Define is compared as a value in the WHERE clause: the field name selects which row is updated, not which column. The weakness is that nothing restricts which rows may be changed, and nothing checks that the request came from the portal's own settings form.

High-level impact: an authenticated admin, or a forged request riding an admin's browser session, can overwrite any existing setting stored in the Settings table in a single request, causing persistent portal misconfiguration. In the upstream schema these settings include the SvxReflector server address and port, system and sysop mail addresses, the TinyMCE API key, and display and login toggles. The code does not allow reading other tables, creating new settings or running additional SQL statements.

Authorization, CSRF and injection flaws are core scope in our web app penetration testing services — have your application checked.

Technical Details

After checking that the session belongs to a logged-in admin, the endpoint iterates over submitted form fields and updates the corresponding Settings rows; each POST key corresponds to a Settings.Define entry and the value is written into Settings.value. The code loops through $_POST, escapes each key and value with real_escape_string, and issues an UPDATE per key. This design assumes every POST key is a valid, allowed setting and that escaping is sufficient to prevent injection.

In practice, the implementation fails in two ways. First, there is no server-side allowlist, so a request can target any existing Settings.Define value, including settings that the form does not show. Second, there is no CSRF token, so the only barrier to a cross-site request is whether the admin's browser sends the PHP session cookie with a cross-site POST, which depends on browser SameSite defaults. Field names that match no Define value are silently ignored. Note that PHP converts spaces and dots in POST field names to underscores before the code sees them. Escaping keeps quote characters inside the string literal, so quote-based payloads in a field name only produce a WHERE value that matches no row. Our CSRF explainer shows which browsers apply those defaults.

Backend weaknesses enabling the issue include: no server-side allowlist of permitted setting names, no CSRF token on the settings form or the endpoint, SQL built by string interpolation rather than prepared statements (escaped correctly here, but harder to audit and maintain), and no audit logging to detect unexpected configuration changes. These safeguards are also important to review during a sql server to snowflake migration, particularly when adapting legacy queries and redesigning data access controls.

Every row of Settings is loaded by define_settings() and becomes a PHP constant used across the portal. Some values are echoed into pages without output encoding; for example, API_KEY_TINY_CLOUD is printed into the TinyMCE script URL in edit_station.php and station_dash.php. REFLEKTOR_SERVER_ADRESS is used by the admin reflector functions. An overwritten value therefore changes portal behaviour for all users until an admin restores it.

Steps to Reproduce

  1. In a lab instance, log in as an admin (the endpoint requires $_SESSION['is_admin'] > 0). Alternatively, test whether a cross-site form POST from the admin's browser reaches the endpoint with the session cookie; there is no CSRF token check.
  2. Send a POST to admin/update_setings.php whose field name is an existing Define value (for example REFLEKTOR_SERVER_ADRESS) and whose value is the new setting.
  3. Reload the admin Settings page and confirm that the row in the Settings table now holds the submitted value. Restore the original value afterwards.

Proof of Concept (PoC)

Test only in a controlled environment or against systems you are authorized to test. The PoC demonstrates the vector; do not run destructive payloads against production.

Example HTTP request (replace host, session cookie, and path accordingly):

POST /admin/update_setings.php HTTP/1.1
Host: lab.example
Content-Type: application/x-www-form-urlencoded
Cookie: PHPSESSID=<admin_session>

HIDE_MONITOR_BAR=0

Example that overwrites a setting the attacker chooses (lab instance only; 192.0.2.10 is a documentation address):

POST /admin/update_setings.php HTTP/1.1
Host: lab.example
Content-Type: application/x-www-form-urlencoded
Cookie: PHPSESSID=<admin_session>

REFLEKTOR_SERVER_ADRESS=192.0.2.10

Expected result: the REFLEKTOR_SERVER_ADRESS row now holds 192.0.2.10, and portal functions that read that constant use the new address. By contrast, a classic SQL injection payload in a field name, such as dummy=1&' OR '1'='1'-- =1, reaches the query as WHERE Define = '\'_OR_\'1\'=\'1\'--_' after PHP's underscore conversion and escaping, and updates nothing.

Impact

An admin session, or a forged request sent from one, can overwrite any existing portal setting in one request, and the change persists until it is reverted. Examples include redirecting reflector connections to another server address or port, changing the notification mail addresses, swapping the TinyMCE API key, and toggling display or login options. Because the flaw needs admin privileges (PR:H), the realistic threats are a compromised or malicious admin account and cross-site request forgery against a logged-in admin. The endpoint does not expose other tables or allow additional SQL statements.

Remediation

  1. Accept only an allowlist of editable setting names and reject any other POST field.
  2. Add a CSRF token to the settings form and verify it in admin/update_setings.php.
  3. Use a prepared statement (UPDATE Settings SET value = ? WHERE Define = ?) and validate each value against the type the setting expects.
  4. Encode setting values on output, keep the existing admin check, and log every configuration change.
  5. Until the code is fixed, restrict network access to /admin/ and protect admin accounts with strong, unique credentials.

References

background
Let's hack you before real hackers do

Stay secure with DeepStrike penetration testing services. Reach out for a quote or customized technical proposal today

Contact Us