GHSA-9W6C-J57C-94FJ
OpenRemote asset-scoped rulesets let restricted users create alarms for out-of-subtree assets via AlarmFacade
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-9W6C-J57C-94FJ divulgada · CVSS 5.3 (GitHub) | |
| Remediación | Parche 1.34.0 | io.openremote:openremote-manager · 4 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
OpenRemote's `AlarmFacade`, which exposes alarm creation to the rules engine, does not verify that target asset identifiers belong to the rule's scope subtree. A restricted user holding `write:rules` can deploy a JSON asset-scoped ruleset on one of their linked assets and use it to create alarms, including `HIGH` severity alarms that trigger operator notifications, linked to arbitrary other assets in the same realm that are outside the ruleset's subtree. The affected code lacks the scope check that the fix for CVE-2026-49439 (GHSA-xj53-j257-hxvg) added to `PredictedFacade` and `HistoricFacade`, so an asset-scoped ruleset escapes its subtree boundary for alarm operations.
The practical gain is a bypass of role separation: a restricted user who has `write:rules` but not `write:alarms` can create alarms against assets they cannot otherwise access. Non-restricted `write:rules` users gain nothing, because they can already create realm-scoped rulesets that legitimately reach every asset in the realm. Users holding `write:alarms` gain nothing either, because the alarm REST API already allows linking alarms to any asset in the realm.
Root Cause
The rules engine builds a per-ruleset `AlarmFacade` that forwards `create` calls directly to `AlarmService.sendAlarm`. `AlarmService.validateAssetsInRealm` only checks that each asset id belongs to the alarm's realm, and the `sendAlarm` javadoc states, "Callers are responsible for enforcing realm authorization." No subtree scope check runs anywhere on the path, so the facade is trusted to apply that check but does not.
For contrast, the sibling `PredictedFacade` and `HistoricFacade` receive an `AssetStorageService` and call `FacadeHelper.doesRuleEngineScopeAllowAccess` before every asset access; that helper adds a `PathPredicate` for asset-scoped rulesets. `AlarmFacade` is constructed without an `AssetStorageService` and never invokes `FacadeHelper`, so the subtree scope enforcement that the CVE-2026-49439 fix introduced never runs for alarm operations.
manager/src/main/java/org/openremote/manager/rules/facade/AlarmFacade.java (create, linkAssets)
manager/src/main/java/org/openremote/manager/rules/RulesEngine.java (AlarmFacade construction, no AssetStorageService)
manager/src/main/java/org/openremote/manager/rules/JsonRulesBuilder.java (RuleActionAlarm dispatch, target.custom resolution)
manager/src/main/java/org/openremote/manager/alarm/AlarmService.java (sendAlarm, linkAssets, validateAssetsInRealm)Impact
Prerequisites:
- A restricted user account in the realm that holds `write:rules` and is linked to at least one asset, so it can create an `AssetRuleset` on that asset. JSON rulesets do not require super-user.
- Knowledge of the ids of the target assets. Asset ids are random, and a restricted user's asset-scoped rules can only query assets in their own subtree, so the ids have to be learned some other way.
- Access to the target asset's subtree is not required.
Demonstrated capability: an asset-scoped ruleset can create alarms whose `ALARM_ASSET_LINK` rows reference asset ids that are outside the rule's asset subtree but inside the same realm. Because `AlarmService.sendAlarm` invokes `sendAssigneeNotification` for `HIGH` severity alarms, the attacker can drive email and push notifications about arbitrary in-realm assets:
- If `assigneeId` is set, only that user is notified.
- If `assigneeId` is omitted, every user in the realm holding `write:alarms` and every super-user is notified, which is the broadest notification blast radius.
The persisted alarm records look indistinguishable from legitimate ruleset-generated alarms except by `sourceId`, which is set to the ruleset id.
Plausible consequence: repeated abuse can produce alarm fatigue on real operator dashboards and be used to mask genuine incidents. This is described as a plausible operational consequence of the demonstrated primitive, not an observed outage; the alarm subsystem itself remains available.
Confidentiality is unaffected: `AlarmFacade.create` returns only the new alarm's id, and no attributes of the victim assets are read or exfiltrated. An attacker who assigns the alarm to themselves receives the names of the linked assets in the notification, but they must already know those assets' ids. Integrity is limited to the alarm subsystem: no asset attributes, ruleset definitions, or user records are modified. Availability of the alarm subsystem is preserved.
Proof of Concept
Preconditions:
- OpenRemote deployment with the alarms feature (1.2.0 or later; verified at tags 1.31.1 and 1.33.0 and on main).
- Two assets in the same realm R, e.g. asset A ("Parking Sensor") and asset B
("HVAC Controller"), where B is not a descendant of A.
- Attacker is a restricted user in realm R, linked to asset A, holding write:rules
but not write:alarms. RulesResourceImpl.createAssetRuleset permits restricted users
to create rulesets on their linked assets and only gates on isSuperUser() for the
GROOVY language.
- The alarms binding is exposed to JSON rulesets via JsonRulesBuilder only; Groovy
rulesets have no alarms binding. Use a JSON ruleset as shown below.Reproduction steps:
- Authenticate as the restricted `write:rules` account against the OpenRemote manager.
- Create an AssetRuleset scoped to asset A with the JSON body below, substituting the real asset ids for `<ASSET_A_ID>` and `<VICTIM_ASSET_B_ID>`.
- Wait for the rule condition to fire (the example uses a one-shot timer). Observe that a `HIGH` severity alarm is persisted with `source=ASSET_RULESET`, `realm=R`, and an `ALARM_ASSET_LINK` row referencing `<VICTIM_ASSET_B_ID>`. The configured assignee is notified; if no assignee is set, all realm users with `write:alarms` and all super-users are notified.
{
"name": "alarm-scope-escape",
"rules": [
{
"name": "escape-subtree",
"when": {
"operator": "OR",
"predicates": [
{"timer": "PT1S"}
]
},
"then": [
{
"action": "alarm",
"alarm": {
"title": "Emergency: HVAC controller offline",
"content": "Immediate action required",
"severity": "HIGH"
},
"target": {
"custom": "<VICTIM_ASSET_B_ID>"
},
"assigneeId": "<OPERATOR_USER_ID_OR_NULL>"
}
]
}
]
}Observed behaviour on tag 1.31.1:
- HTTP 200 from POST /api/{realm}/rules/asset with the ruleset body above.
- INSERT into alarm with source='ASSET_RULESET', sourceId=<ruleset id>, realm=R,
severity='HIGH'.
- INSERT into ALARM_ASSET_LINK(sentalarm_id, realm, asset_id) with
asset_id=<VICTIM_ASSET_B_ID>.
- sendAssigneeNotification dispatched because severity=HIGH (to the assignee, or to
all realm write:alarms users and super-users when no assignee is set).Attack Chain
- Exposure: The REST endpoint `POST /api/{realm}/rules/asset` (`RulesResourceImpl.createAssetRuleset`) accepts JSON `AssetRuleset` documents from any account with `write:rules`, including restricted users for their linked assets. The `isSuperUser()` gate only rejects Groovy rulesets. Restricted users are rejected by `createRealmRuleset`, so the asset-scoped ruleset is their only route to the rules engine.
- Control: The attacker fully controls the JSON body, including each `RuleActionAlarm` action's alarm fields (`title`, `content`, `severity`, `assigneeId`) and its `target.custom` string. `RuleActionTarget.custom` is documented as "A custom string that the Rule Action interprets to generate targets" and is not parsed or filtered before dispatch.
- Path: On deployment, `RulesetDeployment.compileRulesJson` constructs a `JsonRulesBuilder` and passes the shared `alarmsFacade`. When the rule fires, `JsonRulesBuilder.getRuleActionTargetIds` reaches the `target.custom` branch, which returns `Collections.singleton(target.custom)` without invoking `AssetsFacade` or any `PathPredicate`; the attacker's raw asset id is used as the target set.
- Path: The action dispatch sets `sourceId` to the ruleset id and calls `alarmsFacade.create(finalAlarm, assetIds)`. The facade sets the realm from the engine's `RulesEngineId` and forwards to `AlarmService.sendAlarm`.
- Guard: No scope check runs. `AlarmFacade` is constructed as `new AlarmFacade<>(id, alarmService)` with no `AssetStorageService`, so `FacadeHelper.doesRuleEngineScopeAllowAccess` is not called anywhere on this path. `AlarmService.sendAlarm` invokes `validateAssetsInRealm`, which enforces realm membership only.
- Primitive: `AlarmService.sendAlarm` persists a `SentAlarm` and calls `linkAssets`, which inserts one `ALARM_ASSET_LINK` row per attacker-supplied asset id. For `severity=HIGH`, `sendAssigneeNotification` is invoked.
- Result: The attacker, whose ruleset is scoped to a single asset subtree and who may not hold `write:alarms`, has created a persistent alarm record linked to arbitrary same-realm assets outside the subtree. When `HIGH` severity is used, this also triggers operator notifications about those assets. The rule scope boundary that the CVE-2026-49439 fix established for datapoint operations is not enforced for alarm operations.
`AlarmFacade.linkAssets` has the same missing check and additionally accepts any alarm id in the realm, but no ruleset language currently calls it (JSON rules only call `create`, and Groovy has no `alarms` binding). It should be fixed as defense in depth rather than treated as a separately exploitable path.
Bypass Evidence
The fix for CVE-2026-49439 added `FacadeHelper.doesRuleEngineScopeAllowAccess` and applied it to `PredictedFacade` and `HistoricFacade`; the same helper continues to enforce the subtree boundary in those facades. It is never invoked for alarm operations: `AlarmFacade` contains no reference to `FacadeHelper`, `doesRuleEngineScopeAllowAccess`, or `assetStorageService` at tags 1.31.1 and 1.33.0 or on `main`, and its constructor does not receive an `AssetStorageService` from `RulesEngine`. The prior fix therefore does not touch this code path.
The related advisory GHSA-fpfm-c6j3-w4mc, which covers active-realm checks in `RulesResourceImpl`, `GatewayClientResourceImpl`, and `GatewayServiceResourceImpl`, addresses REST-resource realm gating on a different set of endpoints and does not affect the facade's asset scope check.
Attempts to disprove the finding:
- Other JSON target selectors (`target.assets` and `target.users`) flow through `AssetsFacade`/`UsersFacade` with `PathPredicate` restrictions, so they do not exhibit the bypass; the `target.custom` selector remains the unfiltered vector.
- The `alarms` binding is exposed to JSON rulesets via `JsonRulesBuilder` but not to Groovy rulesets, so the Groovy-language super-user gate cannot mitigate the JSON path.
- Global rulesets fail before reaching alarm logic (`AlarmFacade.create` calls `rulesEngineId.getRealm().orElseThrow()` and global engines have `realm=null`).
- Realm-scoped rulesets are expected to reach any asset in their realm, and can only be created by non-restricted users, so only asset-scoped rulesets created by restricted users exhibit a meaningful scope escape.
- The alarm REST API (`AlarmResourceImpl`) applies no restricted-user rules, so a user holding `write:alarms` can already link alarms to any asset in the realm; the escalation is therefore specific to restricted users without `write:alarms`.
Affected Versions
- Ecosystem: `maven`
- Package: `io.openremote:openremote-manager`
- Affected range: `>= 1.2.0, <= 1.33.0`
- Latest release checked: `1.33.0`
- Fix status: not fixed on any released tag or on the `main` branch as of commit `6c7447f8e`
The alarms feature, including `AlarmFacade`, was introduced in commit `11c4a9a60` ("Add alarms feature", 2024-09-10), first released in tag `1.2.0`, and has never contained a subtree scope check. Later commits that touched `AlarmFacade.java` (`1ce1ebb07`, "Super admin can't open or delete alarms in other realms", and `e3a066dcf`, "Apply Spotless") did not add one.
Suggested Fix
The security invariant to enforce is: for an asset-scoped ruleset, every asset id passed to an alarm operation must resolve to an asset inside the ruleset's asset subtree; for a realm-scoped ruleset, every asset id must belong to the ruleset's realm. This is the same invariant the fix for CVE-2026-49439 established for datapoint operations.
Suggested remediation shape (not authoritative):
- Pass an `AssetStorageService` into `AlarmFacade`'s constructor from `RulesEngine`, matching the shape of `PredictedFacade` and `HistoricFacade`.
- In `AlarmFacade.create`, reject (and log) any `assetIds` that fail `FacadeHelper.doesRuleEngineScopeAllowAccess(rulesEngineId, assetId, assetStorageService)` before delegating to `AlarmService`, consistent with how `sendAlarm` already fails on a realm mismatch. Applying the same helper avoids introducing a second scope-checking mechanism.
- Apply the same check in `AlarmFacade.linkAssets` as defense in depth, and restrict it to alarms the ruleset created, since it currently accepts any alarm id in the realm.
- Consider extending the same review to sibling facades that also delegate to services with the "callers are responsible for enforcing realm authorization" contract, in particular `WebhooksFacade` and `NotificationsFacade`.
Out of scope for this advisory but found during validation: `alarm.assigneeId` is not checked against the alarm's realm, and the assignee lookup is not realm-scoped. On both the rules path and the REST `createAlarm` path, a known user id from another realm would receive the alarm's notification. This should be tracked separately.
Interim mitigation without a code change: do not grant `write:rules` to restricted users unless they are trusted with realm-wide alarm authority, and monitor alarms whose `source` is `ASSET_RULESET` for `ALARM_ASSET_LINK` entries that reference assets outside the ruleset asset's subtree.
---
Reported by zx (GitHub: @manus-pi).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
mavenio.openremote:openremote-manager |
Corregida | 1.34.0 | 4 d | 1.34.1 no afectada |
1.34.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/openremote/core/security/advisories/GHSA-9w6c-j57c-94fjLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
