Skip to content

2.4.3

Latest

Choose a tag to compare

@simondeziel simondeziel released this 26 Nov 23:55
· 19 commits to main since this release
Immutable release. Only release title and notes can be modified.
4975d6e

Important Notes

This release fixes a security issue where WebSocket connections (wss://) used by Instance.execute() and Client.events() did not verify the server's TLS certificate, even when server verification was enabled on the HTTPS Client (via verify=True or a pinned certificate path). An active network attacker able to intercept WebSocket connections could read command stdin or replace stdout/stderr and event data.

WebSocket connections now enforce the same TLS verification policy as HTTP requests (CA/hostname verification for verify=True or a CA bundle, and SHA-256 fingerprint pinning for a pinned server certificate). When server verification is enabled, a custom websocket_client passed to Client.events() must be a ws4py.client.WebSocketBaseClient subclass so pylxd can apply TLS verification; otherwise ClientConnectionFailed is raised.

Thanks to Artur Chlebicki (@Artur12555) for reporting this issue. See GHSA-3wgp-hmvf-xj8h for full details.

This release also fixes a security issue where calling pylxd.client.get_session_for_url() for an https:// endpoint without specifying verify (or with verify=None) overwrote requests's default with session.verify = None, silently disabling TLS server certificate verification when neither REQUESTS_CA_BUNDLE nor CURL_CA_BUNDLE was set (including when passing that session into Client(..., session=session)). Regular Client("https://...") usage without a custom session= was not affected.

get_session_for_url() now treats verify=None as unspecified and preserves requests.Session's default verify=True. Callers using get_session_for_url() against an LXD server with a self-signed certificate should pass verify="/path/to/server.crt" to pin the server certificate (or verify=False to explicitly opt out of verification).

See GHSA-3797-r4pr-24mv for full details.

What's Changed

New Contributors

Full Changelog: 2.4.2...2.4.3