DEV Community

facilishz
facilishz

Posted on

CODESYS WebSocket cleanup needs connection-lifetime ownership

CODESYS WebSocket cleanup needs connection-lifetime ownership

CVE-2026-79626 is a use-after-free in the WebSocket handling of CODESYS Control web servers. An unauthenticated remote attacker can send a crafted WebSocket frame that accesses a released connection object and crashes the runtime.

The affected CODESYS products span automation controllers, HMI runtimes and runtime toolkits. The two fixed release groups are 3.5.22.50 and 4.24.0.0. The advisory says default configurations are unaffected, so asset owners need to determine whether the web-server component and WebSocket path are enabled.

The memory-safety issue is tied to object lifetime. The WebSocket handler continues to use a connection object after another part of the server has released it. A malformed sequence of frames exposes that stale reference and turns a protocol edge case into denial of service.

Upgrade to the fixed build for the exact product and release line. Do not assume a generic CODESYS version check covers every industrial package. Inventory the runtime, product family, installed build and exposed web-server configuration.

Place controller web interfaces behind an engineering network boundary. A PLC or runtime should not accept WebSocket connections from arbitrary business networks. Restrict source addresses, disable unused web services and preserve the network path needed for authorized engineering tools.

Monitor runtime resets, watchdog events and abnormal process exits after WebSocket activity. Capture network metadata and the responsible engineering workstation before rebooting if operations allow it. Repeated resets without a software update should trigger containment rather than a search for a process to restart.

Test fixed builds in a representative automation lab. Confirm that the web server, HMI access and engineering workflows behave as expected before a production rollout. A control-system patch can affect timing and operational behavior even when the CVE is remote.

The fix addresses the lifetime error, while network segmentation limits who can reach the vulnerable component. Both controls belong in the recovery plan.

References

Top comments (0)