# CVE-2026-58222: Samba: samba ad ldap compare filter injection and trusted-request confusion disclose protected attributes

> Authenticated users can inject LDAP filters to bypass ACLs and disclose protected Active Directory attributes, potentially leading to privilege escalation.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Jul 2026
- **Updated:** 30 Jul 2026
- **Also known as:** AZL-94175, DEBIAN-CVE-2026-58222, ECHO-166a-43f5-1c18, GHSA-fcqv-6jgj-4xxc, UBUNTU-CVE-2026-58222

## What is CVE-2026-58222?

CVE-2026-58222 is a high-severity vulnerability in Red Hat Enterprise Linux 10, published on 30 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

A security flaw combining LDAP filter injection and improper authorization checks was found in Samba Active Directory Domain Controller (AD DC). When processing LDAP Compare requests, Samba fails to properly validate user-supplied attribute names and executes the resulting internal database search in a trusted context, bypassing normal Access Control List (ACL) enforcement. An authenticated low-privilege domain user can exploit these flaws to disclose confidential Active Directory attributes that would normally be inaccessible. The disclosed information may be leveraged to derive sensitive authentication material, potentially leading to privilege escalation and complete domain compromise. For example: In deployments configured with Group Managed Service Accounts (gMSAs), an attacker can extract the "msKds-RootKeyData" attribute and derive gMSA passwords offline, potentially leading to complete domain compromise if privileged gMSAs are present.

Weakness: CWE-90 (Improper Neutralization of Special Elements used in an LDAP Query)

## Which versions are affected by CVE-2026-58222?


## How do I fix CVE-2026-58222?

Apply the vendor's patch.

## Is CVE-2026-58222 being exploited?

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

Public exploit code:

- Exploits CVE-2026-58222 to recover Samba KDS root keys and derive gMSA credentials from a low-privilege domain account. (github_poc): https://github.com/abdelaaziz0/KDSExtract

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-58222 and fix it if it is affected.

What it is: CVE-2026-58222 is a high-severity vulnerability in Red Hat Enterprise Linux 10, published on 30 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-58222 in the wild and no public exploit code.

Affected product: Red Hat Enterprise Linux 10. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-58222/ (Markdown: https://insights.sbomify.com/CVE-2026-58222/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-58222
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-58222
- OSV: https://osv.dev/vulnerability/CVE-2026-58222

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-58222/
Summaries are generated and may contain mistakes; the official description above is the record.
