Summary
A Cross-Site Request Forgery (CSRF) vulnerability in Dolibarr ERP & CRM 22.0.9 allows an attacker to trigger privileged actions through the permission management interface.
By abusing the notes field in perms.php, a remote attacker can trick an authenticated administrator or privileged user into unknowingly escalating privileges for another account.
Affected context
This issue arises in Dolibarr ERP & CRM deployments where users manage roles and permissions through the perms.php interface.
The vulnerability appears when state-changing requests that update permissions and associated notes are accepted without robust CSRF protection, such as anti-CSRF tokens bound to the user session.
It primarily impacts environments where privileged users (administrators, managers) regularly browse external sites, email links, or embedded content while logged into Dolibarr.
Exploit preconditions
- Attack surface: Web application HTTP(S) interface, specifically the permission management endpoint(s) behind
perms.php. - Required access: The attacker needs the victim to be authenticated in Dolibarr with sufficient privileges to modify user permissions (e.g., admin or equivalent).
- Trigger point: Victim's browser loading a malicious page, email, or embedded resource that silently issues crafted HTTP requests to Dolibarr, targeting the notes field and associated permission controls.
- Why exploitation is possible: Critical permission-changing operations lack strong CSRF defenses and rely only on the victim's existing session cookies, allowing a third-party site to induce state changes without explicit user intent.
Why this happens
The root cause is a missing or insufficient CSRF protection mechanism on permission-modification endpoints, mapping directly to CWE-352: Cross-Site Request Forgery.
State-changing HTTP requests related to user permissions and their metadata (including the notes field) can be initiated cross-origin, and the application trusts the browser's cookies as proof of intent.
Additionally, inadequate authorization checks on the server side (CWE-284) and potential exposure of sensitive parameters through predictable or easily manipulated request structures (CWE-598) may compound the risk.
In abstract terms, the application treats any request with valid session credentials as legitimate, without requiring a per-request, user-bound token or explicit confirmation for high-impact operations.
Potential impact
- Attacker-controlled escalation of privileges for existing user accounts.
- Unauthorized granting of administrative or finance-related roles to attacker-controlled accounts.
- Modification of permission notes or audit-related metadata to hinder investigations.
- Lateral movement within the ERP/CRM environment by abusing newly granted capabilities.
- Indirect access to sensitive business data, financial records, or customer information once privileges are elevated.
General mitigation guidance
Effective mitigation focuses on enforcing strong, server-validated intent for all permission-changing operations:
- Require per-request anti-CSRF tokens that are unpredictable, session-bound, and validated on every state-changing request to
perms.phpand related endpoints. - Ensure that permission updates, including changes in the notes field, are processed only via POST (or other non-idempotent) methods with CSRF checks, avoiding sensitive changes over simple GET requests.
- Introduce a privilege-sensitive workflow, such as explicit confirmation or step-up reauthentication for changes that modify user roles or access levels.
- Apply the principle of least privilege so that only strictly necessary roles can alter permissions, reducing the blast radius of a compromised session.
- Normalize and validate all input fields (including notes) but avoid relying on client-side controls for authorization or CSRF defense.
How teams detect issues like this
Detection commonly combines code-centric and behavior-centric approaches:
- Static analysis and code review:
- Flag state-changing endpoints that lack anti-CSRF token validation.
- Identify permission-modification logic in
perms.phpthat accepts cross-origin requests without checking origin, referer, or CSRF tokens. - Review controllers and forms tied to role/permission management to ensure proper method use (POST) and token verification.
- Security test automation:
- Use web security scanners or CI-integrated tools to simulate cross-origin requests to permission endpoints and observe whether changes are accepted without CSRF tokens.
- Add regression tests that assert failure for permission changes when CSRF tokens are missing, invalid, or reused improperly.
- Operational monitoring:
- Monitor logs for anomalous permission changes, especially bursts of updates originating from unexpected IPs, user agents, or referrers.

