mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-08-24 18:16:01 -04:00
5571d5722f
The remote-debugging TCP server authenticates clients with a handshake message carrying a per-tenant key, but onMessage never enforced it: ASSET_CHUNK, the declaration messages and END were all processed while runtime.handshake was still false. The only enforcement was a 10 second timer closing connections that never handshake, and a full registration completes well inside that window, so an unauthenticated client could write assets to media storage, consume connection slots and register arbitrary plugin identities in the node registry. Reject every registration message other than HAND_SHAKE until the handshake completes, close the connection with a handshake failure and latch handshakeFailed so later messages are ignored. The 10 second timer stays as-is.