Summary
Dolibarr contains an authorization bypass in document storage endpoints that may allow unauthenticated attackers to read arbitrary files by supplying a crafted parameter value. Successful exploitation could expose application logs, uploaded business documents, database backups, and files associated with other multicompany entities.
Affected context
The vulnerability occurs in Dolibarr document and image viewing endpoints when request parameters influence token validation and authorization decisions. Deployments may be at risk when these endpoints are internet accessible and the application accepts a parameter value that causes shared access logic to bypass normal authorization checks.
Exploit preconditions
- Attack surface: HTTP document storage and image viewing endpoints
- Required access: No authentication may be required when the affected parameter condition is met
- Trigger point: A request containing a crafted
hashpparameter value - Why exploitation is possible: The parameter can cause token validation to be skipped while still satisfying an authorization condition, allowing access to files outside the requester's intended scope
Why this happens
The underlying bug is an authorization decision that trusts a user-controlled parameter and evaluates a special value as sufficient authorization. This creates an inconsistent security check in which token validation is bypassed while access is still granted. The behavior maps to CWE-863, Incorrect Authorization, because the application fails to reliably enforce permissions before returning protected files.
Potential impact
- Attackers may read application logs containing operational or security data
- Attackers could access uploaded business documents
- Database backups containing password hashes may be exposed
- Files belonging to other multicompany entities may be disclosed
- Exposed information can support follow-on account compromise or targeted attacks
General mitigation guidance
Mitigation generally focuses on making authorization decisions independent of
attacker-controlled parameters and applying checks consistently to every file
retrieval path.
Common defensive patterns include:
- Require authenticated, server-validated authorization for every document and image request
- Treat special parameter values as data rather than implicit permission grants
- Bind file access decisions to the requesting user, organization, and resource ownership
- Apply deny-by-default access controls and least privilege across multicompany entities
- Keep logs, backups, and application storage outside directly retrievable web paths
- Reduce input trust by validating identifiers against an allowlisted resource scope
- Avoid exposing sensitive files through endpoints that do not enforce centralized authorization
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis rules identifying authorization branches controlled by request parameters
- Code review checks for token-validation bypasses and special-value access paths
- Tests that request documents without authentication and across tenant or entity boundaries
- Dynamic monitoring for unusual document endpoint requests and repeated parameter manipulation
- Policy enforcement requiring centralized authorization before file reads
- Automated security review tools that flag missing authorization checks or inconsistent access-control paths

