On Fri, Oct 30, 2026 at 12:47:11PM +0100, Michal Privoznik via Devel wrote:
> From: Michal Privoznik <[email protected]>
> 
> The usual flow of SASL is REMOTE_PROC_AUTH_SASL_INIT followed by
> REMOTE_PROC_AUTH_SASL_START which can either complete
> authentication or require further steps which are then done by
> calling REMOTE_PROC_AUTH_SASL_STEP (multiple times even).
> 
> But if a malicious client skips the SASL_START step and calls
> SASL_INIT followed by SASL_STEP then the 'sasl->conn' structure
> inside of virNetSASLSessionServerStep() is not fully allocated
> (most notably the list of auth mechanisms 'mech' is NULL). But
> then sasl_server_step() dereferences that pointer leading to a
> crash.
> 
> Fix this by disallowing SASL_STEP until SASL_START completed
> successfully.
> 
> Fixes: CVE-2026-119151
> Resolves: https://gitlab.com/libvirt/libvirt/-/work_items/940
> Signed-off-by: Michal Privoznik <[email protected]>
> ---
> 
> v2 of:
> 
> https://lists.libvirt.org/archives/list/[email protected]/thread/3R2JC6KASBO45SAC7HYFD6QGLZWWYLWJ/
> 
> diff to v1:
> - Implement a state machine to allow just INIT -> START [-> STEP [->
>   STEP ...]] and nothing else,
> - Drop checks additional from remote_daemon_dispatch.c (they were only
>   there to report a nicer error message anyways).
> 
>  src/remote/remote_daemon_dispatch.c |  2 +-
>  src/rpc/virnetsaslcontext.c         | 31 +++++++++++++++++++++++++++++
>  2 files changed, 32 insertions(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <[email protected]>

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|

Reply via email to