Skip to content
GHSA 7jp3 2229 Xgqj

GHSA 7jp3 2229 Xgqj

github.com • November 22, 2026

The MQTT X.509 provisioning flow accepts a certificate copied into an ordinary MQTT message and uses it to authenticate the current MQTT connection. The handler verifies that the supplied certificate was signed by the configured CA, is valid, and has a common name matching the device ID in the topic. It does not verify that the current connection presented that certificate or that the sender possesses the corresponding private key.

As a result, an unauthenticated client that knows the public certificate of an already provisioned device can authenticate its own MQTT connection as that device's existing service account. The attacker does not need the device's private key, username, or password.

The vulnerable code is in manager/src/main/java/org/openremote/manager/mqtt/UserAssetProvisioningMQTTHandler.java :

canPublish() allows a connection to publish to provisioning/{device-id}/request when the topic is syntactically valid ( :275-284 ). It does not require that the connection is already authenticated.

processX509ProvisioningMessage() reads the certificate from the MQTT payload ( :393-418 ) and validates the certificate/configuration and the certificate CN/topic ID relationship ( :420-473 ).

getMatchingX509ProvisioningConfig() verifies the supplied certificate's issuer, CA signature, and validity period ( :561-634 ). These checks validate the certificate itself, but do not bind it to the transport connection.

getCreateClientServiceUser() returns the existing service account for an already provisioned device instead of creating a new identity ( :637-650 ). The service user's secret is available through the User entity's service-account client relation.

The handler authenticates the current connection with that existing service user's credentials ( :541-554 ). MQTTBrokerService.authenticateConnection() clears the connection subject and authenticates the anonymous connection as the service user ( manager/src/main/java/org/openremote/manager/mqtt/MQTTBrokerService.java:761-772 ).

The message model contains only a PEM certificate: model/src/main/java/org/openremote/model/provisioning/X509ProvisioningMessage.java:23-32 . It contains no nonce, signature, challenge response, or other proof of private key possession.

After successful impersonation, the attacker receives exactly the permissions assigned to the targeted device's service account. Depending on the provisioning configuration, this can allow the attacker to:

read assets, attributes, and telemetry available to the device;

write attributes and change device state;

control actuators if the service account has actuator write permissions;

modify or disrupt device operation within the account's asset scope;

access additional assets if the service account was configured with broad realm or asset permissions.

The demonstrated impact is unauthorized modification of a restricted asset attribute. No remote code execution was demonstrated, and the vulnerability does not automatically grant administrator privileges beyond those assigned to the impersonated service account.

network access to the MQTT listener and the ability to publish MQTT messages;

the target device ID used in the provisioning topic;

the target device's public PEM certificate;

a deployment where the target device has already been provisioned.

The attacker does not need:

an OpenRemote account or MQTT username/password;

the target device's private key;

a client certificate presented during the MQTT/TLS handshake in the tested anonymous-listener configuration;

If an operator separately requires mTLS before accepting any MQTT connection, that transport-level control is an additional deployment precondition. The application handler still does not compare a payload certificate with the TLS peer certificate, so the payload must not be treated as a replacement for transport authentication.

The public certificate is not a secret. It may be present in device firmware, device configuration, provisioning packages, logs, support material, or be observable wherever the legitimate provisioning message is transmitted. The certificate still has to be for the target device and signed by the configured CA; a random forged certificate is rejected by the existing CA and validity checks.

The intended first-time provisioning and re-authentication paths the same logic:

An anonymous MQTT connection publishes to the device's provisioning request topic.

The handler parses the PEM certificate from the message body.

The handler verifies the certificate against the configured CA and checks that its CN equals the device ID from the topic.

The handler looks up the existing service-account-provisioning-{deviceId} user. If the user exists, the existing account and its permissions are reused.

The handler calls authenticateConnection() for the current MQTT connection using that service account's stored secret.

Subsequent MQTT authorization checks use the service account subject now attached to the attacker's connection.

The missing security property is proof of possession. A valid public certificate proves only that the certificate was issued by the CA; it does not prove that the sender controls the corresponding private key.

The following reproduces the issue against the tested commit in the local integration environment.

1. Start the test dependencies

Use JDK 21 or later; the tested run used Temurin JDK 25.0.2. Do not run the test until the PoC block in step 2 has been inserted.

The test uses the following existing test resources:

test/src/test/resources/org/openremote/test/provisioning/ca.pem

test/src/test/resources/org/openremote/test/provisioning/device1.pem

test/src/test/resources/org/openremote/test/provisioning/device1.key

The exploit does not use device1.key ; only device1.pem is sent by the attacker.

2. Apply the complete PoC harness

The existing test already creates the building realm, enables X.509 provisioning, creates the device1 asset, and connects two anonymous MQTT clients. Insert the following block immediately after the existing assertion that the legitimate client connection is maintained and immediately before the test's when: "the client gets abruptly disconnected" block.

The attacker connection is already created by the existing test with no username, password, TLS client certificate, or private key:

These setup lines are shown for clarity and are already present in the base test; do not add a second declaration when applying the PoC block.

The test waits until this connection reaches ConnectionStatus.CONNECTED before executing the PoC below.

Before the PoC insertion point, the legitimate client provisions device1 using the same public certificate and the test waits for a successful SuccessResponseMessage :

The block below is the complete dynamic PoC that was executed. It uses the already declared variables device1SnoopClient , mqttDevice1SnoopClientId , device1RequestTopic , device1UniqueId , weatherAsset , provisioningConfig , identityService , managerTestSetup , mqttBrokerService , assetStorageService , and conditions ; the remaining names are already imported by the test. No private key is read or sent.

The preceding test code has already performed the legitimate provisioning request from client A using device1.pem . The inserted block sends the same public certificate from client B, which has a different MQTT client ID and is still anonymous at the transport layer. The response subscription is not used as proof of success; the authoritative checks are the authenticated connection set and the restricted attribute write.

From the repository root, after inserting the block above, run:

The local verification used --offline because all dependencies were already cached; omit it when Gradle should download missing dependencies.

Expected vulnerable result:

The test passes only if the second anonymous connection is accepted as the existing device user and the value 31337 is persisted. With a correct fix, the provisioning request from client B must be rejected or leave its subject anonymous, and the attribute write must fail.

The behavior was verified locally against commit 74f902417fe437e235f6b24757150ea262bda110 using the existing integration environment and the PoC sequence described above. The vulnerable product code was not patched during this verification. The PoC was run through the existing UserAndAssetProvisioningTest infrastructure as a local test harness; the relevant MQTT actions and assertions are included in this report so the maintainer can reproduce them independently.

The local run completed successfully:

The test demonstrated all of the following:

client B connected anonymously with a different MQTT client ID;

client B sent only the public device1.pem certificate;

client B was associated with the existing device1 service account;

client B successfully wrote 31337 to a restricted attribute of the provisioned asset.

The following table summarizes the proof supplied by each assertion:

The provisioning handler treats a CA-valid certificate embedded in an MQTT payload as an authentication credential. It does not establish a cryptographic relationship between that certificate and the connection sending the payload. Consequently, possession of a public certificate is incorrectly treated as proof of identity.

The provisioning flow should authenticate the transport connection using a cryptographic proof tied to the device identity:

For mTLS deployments, validate the client certificate during the TLS handshake and compare the authenticated peer certificate to the certificate used for provisioning. Do not accept a copied PEM as a replacement for the TLS peer identity.

For bootstrap flows that cannot use mTLS, issue a server-side nonce and require the device to sign that nonce with the private key corresponding to the submitted certificate. Verify the signature before calling authenticateConnection() .

Do not re-authenticate an arbitrary existing connection solely because a request contains a valid certificate and a known device ID.

Keep first-time enrollment and re-authentication separate, and bind an existing service account to a device-bound secret or key rather than to a public certificate copied into a message.

Add regression tests for: an anonymous client replaying a legitimate public certificate, expected to receive UNAUTHORIZED ; a different anonymous client replaying the certificate with a different MQTT client ID, expected to remain unauthenticated; a legitimate client proving possession of the private key, expected to authenticate successfully; expired, forged, and wrong-CN certificates, which must remain rejected.

an anonymous client replaying a legitimate public certificate, expected to receive UNAUTHORIZED ;

a different anonymous client replaying the certificate with a different MQTT client ID, expected to remain unauthenticated;

a legitimate client proving possession of the private key, expected to authenticate successfully;

expired, forged, and wrong-CN certificates, which must remain rejected.

Suggested safe behavior

For an existing device, a provisioning request that contains only a public PEM should never be sufficient to authenticate the current MQTT connection. The server should return an authorization error unless the connection has already been authenticated with the matching TLS certificate or has supplied a valid proof-of-possession signature.

manager/src/main/java/org/openremote/manager/mqtt/UserAssetProvisioningMQTTHandler.java

manager/src/main/java/org/openremote/manager/mqtt/MQTTBrokerService.java

model/src/main/java/org/openremote/model/provisioning/X509ProvisioningMessage.java

Existing integration test infrastructure: org.openremote.test.provisioning.UserAndAssetProvisioningTest

Tested commit: 74f902417fe437e235f6b24757150ea262bda110

If the issue is confirmed and the advisory is published, I would appreciate assignment of a CVE ID and credit as the reporter.

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.

Extracted Entities

Platforms (1)