Summary
OpenRemote contains an insecure direct object reference vulnerability in its bulk alarm deletion endpoint, allowing authenticated users to delete alarms belonging to other tenants by specifying arbitrary alarm IDs.
When a user has alarm-write permissions and realm-scoping is not enforced in the deletion query, cross-tenant alarm records can be permanently removed without proper authorization.
Affected context
This vulnerability appears in multi-tenant OpenRemote deployments where alarms are stored using auto-increment identifiers and accessed through a bulk deletion REST endpoint.
It is relevant when users are granted alarm-write permissions but the backend logic does not consistently validate tenant or realm ownership before executing deletion operations.
The issue surfaces specifically in the alarm management API, where object references (alarm IDs) are trusted based solely on user input rather than contextual access control checks.
Exploit preconditions
- Attack surface: Authenticated OpenRemote HTTP API for alarm management, specifically the bulk alarm deletion endpoint.
- Required access: Valid user account with permissions to write or manage alarms in at least one tenant/realm.
- Trigger point: Invocation of the bulk deletion operation with a list of alarm IDs that includes IDs belonging to other tenants.
- Why exploitation is possible: The
removeAlarms()method inAlarmResourceImpl.javaconstructs a JPA deletion query that does not constrain results by the caller's realm or tenant, allowing arbitrary alarm IDs to be targeted and removed.
Why this happens
The core issue is insufficient authorization checks on object references supplied by a client, aligning with CWE-639 (Insecure Direct Object Reference).
Instead of deriving the set of deletable alarms from the authenticated user's realm and permissions, the implementation trusts client-provided IDs directly in a bulk JPA query.
This pattern breaks tenant isolation and role-based access control guarantees because context (realm ownership) is not enforced at the data access layer.
Potential impact
- Authenticated users can delete alarms belonging to other tenants.
- Loss of critical monitoring or notification data across realms.
- Disruption of operational alerting and incident workflows.
- Potential regulatory or contractual violations due to cross-tenant data tampering.
- Erosion of trust in the platform's multi-tenant isolation guarantees.
General mitigation guidance
Effective mitigation focuses on enforcing strict authorization around object references and ensuring tenant isolation at every data access boundary.
Common defensive patterns include:
- Deriving deletable alarm IDs from the authenticated user's realm and roles instead of trusting client-supplied IDs.
- Adding realm or tenant predicates to all JPA queries that read or modify multi-tenant data.
- Implementing centralized access-control checks at the service or repository layer to avoid ad hoc authorization logic.
- Using indirect references (e.g., opaque tokens or scoped identifiers) that cannot be easily enumerated across tenants.
- Designing APIs so bulk operations operate only on server-selected resources scoped to the caller's context.
How teams detect issues like this
Organizations can detect similar IDOR issues by:
- Applying static analysis and code scanning rules that flag direct use of client-supplied IDs in CRUD operations without accompanying authorization checks.
- Reviewing controller and resource classes for multi-tenant data access that lack realm or tenant constraints in queries.
- Enforcing architectural policies that all data-access methods accept an explicit tenant/realm parameter and validate it against the current principal.
- Using automated security testing (e.g., API fuzzing or authorization testing tools) to attempt cross-tenant access with manipulated IDs.
- Conducting targeted code reviews of bulk operations and administrative endpoints, looking for enumeration-friendly numeric identifiers.

