I think the OP's question is whether the server code can be manipulated to request that information. Electrum client does have access to the device ID, and it would make sense that it's not sent it to the server, but are there any safeguards prevent the server from accessing the device ID?
As far as I can tell... it is mostly simple request/response initiated from the
client... That is to say, the client sends a request, the server sends a response.
However, as per
the Electrum Protocol, the client does receive "notifications" when it has "subscribed" to receive updates regarding various scripthashes.
But this is not the server querying the client as such, it is simply sending a message with the updated data.
Also, from my limited testing on my personal electrs server, the requests made from the client when using a Trezor, look much like the requests made from a client using a "standard" wallet. I don't see anything obvious in the raw request data that would enable you to differentiate between the two types of wallets.
I realize this is an Electrum thread, but I am reminding readers that Satoshi Labs grabs the device # for sure and even uses it in the connection url's ----- bothersome for sure!
I guess that's because the wallet "client" and "server" are essentially the same thing when using the Satoshi Labs web wallet... but yes, deviceID being transmitted in URL plaintext is a bit of a privacy concern.