Описание
Admidio has CSRF and Form Validation Bypass in Inventory Item Save via imported Parameter
Summary
The inventory module's item_save endpoint accepts a user-controllable POST parameter imported that, when set to true, completely bypasses both CSRF token validation and server-side form validation. An authenticated user can craft a direct POST request to save arbitrary inventory item data without CSRF protection and without the field value checks that the FormPresenter validation normally enforces.
Details
In modules/inventory.php, the imported parameter is read from POST input:
File: modules/inventory.php:50
This is then passed to ItemService:
File: modules/inventory.php:251-256
Inside ItemService::save(), the postImported flag completely skips CSRF and form validation:
File: src/Inventory/Service/ItemService.php:99-109
When imported=1 is sent, the code:
- Skips
$gCurrentSession->getFormObject()— which validates the CSRF token - Skips
$itemFieldsEditForm->validate()— which sanitizes and validates field values - Uses raw
$_POSTvalues directly to save to the database
This means:
- CSRF protection is completely bypassed — an external website can trick a logged-in user into modifying inventory data
- Form validation is bypassed — field type checks, required field checks, and input sanitization are all skipped
- Raw user input flows into
$this->itemRessource->setValue()and thensaveItemData()without the normal server-side sanitization
PoC
A CSRF attack page would look like:
Impact
- CSRF bypass: An attacker can trick any logged-in inventory user into creating or modifying inventory items by having them visit a malicious page.
- Validation bypass: Server-side field type validation, required field checks, and input sanitization are all skipped, allowing arbitrary data to be stored.
- Stored XSS potential: Because
validate()is bypassed, unsanitized input may be stored and later rendered to other users (dependent on output encoding in the view layer).
Recommended Fix
Remove the imported parameter bypass from the save logic, or at minimum always validate the CSRF token regardless of the imported flag:
Alternatively, the imported flag should only be set by the import workflow itself (via a session variable set during the import process), rather than being controllable via direct POST input.
Пакеты
admidio/admidio
<= 5.0.7
5.0.8
Связанные уязвимости
Admidio is an open-source user management solution. Prior to version 5.0.8, the inventory module's item_save endpoint accepts a user-controllable POST parameter imported that, when set to true, completely bypasses both CSRF token validation and server-side form validation. An authenticated user can craft a direct POST request to save arbitrary inventory item data without CSRF protection and without the field value checks that the FormPresenter validation normally enforces. This issue has been patched in version 5.0.8.