CVE-2021-20254
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedA flaw was found in samba. The Samba smbd file server must map Windows group identities (SIDs) into unix group ids (gids). The code that performs this had a flaw that could allow it to read data beyond the end of the array in the case where a negative cache entry had been added to the mapping cache. This could cause the calling code to return those values into the process token that stores the group membership for a user. The highest threat from this vulnerability is to data confidentiality and integrity.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceA buffer over-read vulnerability exists in Samba's smbd file server where the code that maps Windows SIDs to Unix GIDs can read beyond array bounds when negative cache entries exist in the mapping cache. This causes incorrect group membership data to be returned in the user process token, potentially exposing unauthorized group associations.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data= 32= 33= 7.0= 8.0= 9.0>= 3.6.0, < 4.12.15>= 4.13.0, < 4.13.8>= 4.14.0, < 4.14.4CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- High
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- None
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Check if Samba smbd is runningRun command: ps aux | grep smbd | grep -v grep. Also check if winbind service is active: systemctl status winbind or ps aux | grep winbindAffected if smbd or winbind services are running - these are the components that contain the vulnerable SID-to-GID mapping code
-
Determine installed Samba versionRun: smbstatus --version or rpm -q samba or dpkg -l samba (depending on distribution). Compare output to affected ranges: < 4.12.15, >= 4.13.0 to < 4.13.8, >= 4.14.0 to < 4.14.4Affected if Installed version falls within any of the affected ranges (>= 3.6.0 to < 4.12.15, >= 4.13.0 to < 4.13.8, or >= 4.14.0 to < 4.14.4)
-
Check if Samba is configured for domain/Active Directory integrationExamine /etc/samba/smb.conf for 'idmap config' directives or 'winbind' settings. Look for lines containing 'idmap' or 'winbind'. Also check if /etc/nsswitch.conf includes 'winbind' for passwd/groupAffected if Samba is configured to use winbind for user/group mapping (idmap or winbind directives present in config) - this enables the vulnerable SID-to-GID mapping code path
-
Verify if negative cache entries could exist in the SID mapping cacheCheck for cache files in /var/cache/samba/ or /tmp/ related to winbind. On some systems, examine: ls -la /var/lib/samba/*.tdb or ls -la /var/cache/samba/*.tdbAffected if Samba/winbind has been actively used for SID-to-UID/GID mapping, creating cache entries that could include negative cache entries triggering the over-read
-
Review group membership mappings for anomaliesRun: wbinfo --group-info=<groupname> for various groups, or use 'getent group' to list all groups. Compare results against expected Unix group membershipsAffected if Group membership returns differ from expected or show unexpected group associations - indicating potential exploitation of the over-read affecting group token data
You are affected if Samba smbd/winbind is running with a version in the affected ranges AND Samba is configured for SID-to-GID mapping (winbind or idmap config), especially if group membership results appear incorrect.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
From vendor data4.12.154.13.84.14.4
Update Samba to the patched version that addresses this out-of-bounds read in the SID-to-gid mapping cache. Verify group membership mappings function correctly after the update.
- Consultation2.0 h
- Implementation3.0 h
- Testing6.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,520.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2021-20254 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2021-20254 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data