Data connections v1 leaks driver id + RawPath to UNS-only peers via stable_source_id #916

Closed
opened 2026-11-23 16:23:07 -05:00 by dohertj2 · 1 comment
Owner

Found while planning remote history + alarm forwarding (docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md, N3); confirmed in code 2026-11-23.

Problem

gRPC data connections v1 sends DataMetadata.stable_source_id (data_connection.proto:133) to the peer for every exported variable, including UNS-realm exports. For a driver source it is built by SourceKey.ForDriver as <len>:<driverInstanceId><driver reference> (src/Server/ZB.MOM.WW.OtOpcUa.Runtime/DataConnections/SourceSamplePublisher.cs:32-33) and placed in metadata at LocalExportCatalog.Compilation.cs:92.

So a peer granted only a UNS export learns the origin's driver instance ids and raw driver references / RawPaths — Raw-realm structure its DataExport grant does not cover. Realm separation is otherwise enforced (e.g. OtOpcUaNodeManager.cs:4885, DataPlaneAuthorizer.cs:182).

Impact

Information disclosure to an authenticated peer cluster (service principal), not to anonymous clients. Check whether the consumer re-exposes it to its own OPC UA clients.

Fix direction

Send an opaque per-export identifier (e.g. a keyed hash, as the plan proposes for conditions with DataConnections:ConditionKeySecret) instead of the raw key, or omit the field for exports whose realm differs from the source. Keep the internal BackingSourceKey unchanged. Mind mixed-version consumers that may compare the field.

v1 is merged (95c5e484) but not deployed (#915), so this can be fixed before any deployment.

Found while planning remote history + alarm forwarding (`docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md`, N3); confirmed in code 2026-11-23. ## Problem gRPC data connections v1 sends `DataMetadata.stable_source_id` (`data_connection.proto:133`) to the peer for every exported variable, **including UNS-realm exports**. For a driver source it is built by `SourceKey.ForDriver` as `<len>:<driverInstanceId><driver reference>` (`src/Server/ZB.MOM.WW.OtOpcUa.Runtime/DataConnections/SourceSamplePublisher.cs:32-33`) and placed in metadata at `LocalExportCatalog.Compilation.cs:92`. So a peer granted only a UNS export learns the origin's driver instance ids and raw driver references / RawPaths — Raw-realm structure its `DataExport` grant does not cover. Realm separation is otherwise enforced (e.g. `OtOpcUaNodeManager.cs:4885`, `DataPlaneAuthorizer.cs:182`). ## Impact Information disclosure to an authenticated peer cluster (service principal), not to anonymous clients. Check whether the consumer re-exposes it to its own OPC UA clients. ## Fix direction Send an opaque per-export identifier (e.g. a keyed hash, as the plan proposes for conditions with `DataConnections:ConditionKeySecret`) instead of the raw key, or omit the field for exports whose realm differs from the source. Keep the internal `BackingSourceKey` unchanged. Mind mixed-version consumers that may compare the field. v1 is merged (`95c5e484`) but not deployed (#915), so this can be fixed before any deployment.
dohertj2 added the type:review-findingpriority:p2 labels 2026-11-23 16:23:07 -05:00
Author
Owner

Fixed on master 4ac83085: stable_source_id (field 10) is no longer encoded or decoded in any realm (proto field deprecated, not renumbered); internal BackingSourceKey unchanged. v1 goldens not re-recorded — compared through a narrowly-pinned correction step. Evidence docs/plans/evidence/grpc-data-ext/V1-916-917.md.

Fixed on master 4ac83085: stable_source_id (field 10) is no longer encoded or decoded in any realm (proto field deprecated, not renumbered); internal BackingSourceKey unchanged. v1 goldens not re-recorded — compared through a narrowly-pinned correction step. Evidence docs/plans/evidence/grpc-data-ext/V1-916-917.md.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#916