CVE-2021-3738 Use after free in samba

High 8.8 Published Updated

A use-after-free in Samba's DCE/RPC association groups can cause crashes or potentially allow privilege escalation by pointing to invalid session data.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-3738?

CVE-2021-3738 is a high-severity use after free vulnerability in Samba Samba, published on 2 Mar 2022. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

In DCE/RPC it is possible to share the handles (cookies for resource state) between multiple connections via a mechanism called 'association groups'. These handles can reference connections to our sam.ldb database. However while the database was correctly shared, the user credentials state was only pointed at, and when one connection within that association group ended, the database would be left pointing at an invalid 'struct session_info'. The most likely outcome here is a crash, but it is possible that the use-after-free could instead allow different user state to be pointed at and this might allow more privileged access.

Weakness: CWE-416

Which versions are affected by CVE-2021-3738?

It affects 1 product.

Products include Samba Samba.

How do I fix CVE-2021-3738?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2021-3738 being exploited?

There is no known exploitation of CVE-2021-3738 in the wild and no public exploit code.

All Samba Samba vulnerabilities

Sources

Also known as ALPINE-CVE-2021-3738, AZL-37005, AZL-8905, CLSA-2025-1760370936, CLSA-2025-1765285897, DEBIAN-CVE-2021-3738 and 3 more.

Is CVE-2021-3738 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free