CVE-2022-32746: Use After Free

Published Jul 18, 2022
·
Updated

A flaw was found in the Samba AD LDAP server. The AD DC database audit logging module can access LDAP message values freed by a preceding database module, resulting in a use-after-free issue. This issue is only possible when modifying certain privileged attributes, such as userAccountControl.

Other sources

As per samba upstream advisory:

Some database modules make a shallow copy of an LDAP add/delete message so they can make modifications to its elements without affecting the original message. Each element in a message points to an array of values, and these arrays are shared between the original message and the copy.

The issue arises when a database module adds new values to an existing array. A call to realloc() increases the array's size to accommodate new elements, but at the same time, frees the old array. This leaves the original message element with a dangling pointer to a now-freed array. When the database audit logging module subsequently logs the details of the original message, it will access this freed data, generally resulting in corrupted log output or a crash.

The code paths susceptible to this issue are reachable when certain specific attributes, such as userAccountControl, are added or modified. These attributes are not editable by default without having a privilege assigned, such as Write Property.

— Red Hat

Affected Software

21 affected componentsFixes available
Samba Samba>=4.3.0<4.14.14
Samba Samba>=4.15.0<4.15.9
Samba Samba>=4.16.0<4.16.4
debian/samba
2:4.17.12+dfsg-0+deb12u42:4.22.11+dfsg-0+deb13u12:4.22.10+dfsg-0+deb13u22:4.25.1+dfsg-1
alpine/samba>=4.3.0<4.14.14-r0
4.14.14-r0
alpine/samba>=4.3.0<4.15.12-r0
4.15.12-r0
alpine/samba>=4.3.0<4.15.12-r0
4.15.12-r0
alpine/samba>=4.3.0<4.15.9-r0
4.15.9-r0
alpine/samba>=4.3.0<4.15.9-r0
4.15.9-r0
alpine/samba>=4.3.0<4.15.9-r0
4.15.9-r0
alpine/samba>=4.3.0<4.15.9-r0
4.15.9-r0
alpine/samba>=4.3.0<4.15.9-r0
4.15.9-r0
alpine/samba>=4.3.0<4.15.9-r0
4.15.9-r0
alpine/samba>=4.3.0<4.15.9-r0
4.15.9-r0
alpine/samba>=4.3.0<4.15.9-r0
4.15.9-r0
debian/samba<2:4.16.4+dfsg-1
2:4.16.4+dfsg-1
debian/samba<2:4.16.4+dfsg-1
2:4.16.4+dfsg-1
debian/samba<2:4.16.4+dfsg-1
2:4.16.4+dfsg-1
redhat/samba<4.16.4
4.16.4
redhat/samba<4.15.9
4.15.9
redhat/samba<4.14.14
4.14.14

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/samba to a version that resolves this vulnerability.

    Fixed in 2:4.17.12+dfsg-0+deb12u4Fixed in 2:4.22.11+dfsg-0+deb13u1Fixed in 2:4.22.10+dfsg-0+deb13u2Fixed in 2:4.25.1+dfsg-1
  2. Upgrade

    Upgrade alpine/samba to a version that resolves this vulnerability.

    Fixed in 4.14.14-r0
  3. Upgrade

    Upgrade alpine/samba to a version that resolves this vulnerability.

    Fixed in 4.15.12-r0
  4. Upgrade

    Upgrade alpine/samba to a version that resolves this vulnerability.

    Fixed in 4.15.9-r0
  5. Upgrade

    Upgrade debian/samba to a version that resolves this vulnerability.

    Fixed in 2:4.16.4+dfsg-1
  6. Upgrade

    Upgrade redhat/samba to a version that resolves this vulnerability.

    Fixed in 4.16.4
  7. Upgrade

    Upgrade redhat/samba to a version that resolves this vulnerability.

    Fixed in 4.15.9
  8. Upgrade

    Upgrade redhat/samba to a version that resolves this vulnerability.

    Fixed in 4.14.14

Event History

Jul 18, 2022
Data Sourced
via Red Hat·03:36 PM
DescriptionSeverityAffected Software
Aug 25, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionWeakness
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·06:15 PM
DescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the vulnerability ID?

The vulnerability ID is CVE-2022-32746.

2

What is the severity of CVE-2022-32746?

The severity of CVE-2022-32746 is medium (5.4).

3

What is the affected software?

The affected software is Samba Samba versions 4.3.0 to 4.14.14, 4.15.0 to 4.15.9, and 4.16.0 to 4.16.4.

4

What is the description of CVE-2022-32746?

CVE-2022-32746 is a use-after-free issue in the Samba AD LDAP server, where the AD DC database audit logging module can access freed LDAP message values, resulting in a use-after-free issue when modifying certain privileged attributes.

5

How can I fix CVE-2022-32746?

To fix CVE-2022-32746, it is recommended to update Samba to a version that includes the fix provided by the vendor.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203