Bug 1213174 (CVE-2022-2127)

Summary: VUL-0: CVE-2022-2127: samba: Out-Of-Bounds read in winbind AUTH_CRAP
Product: [Novell Products] SUSE Security Incidents Reporter: Robert Frohl <rfrohl>
Component: IncidentsAssignee: Security Team bot <security-team>
Status: NEW --- QA Contact: Security Team bot <security-team>
Severity: Normal    
Priority: P3 - Medium CC: meissner, nopower, scabrero
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://smash.suse.de/issue/371617/
Whiteboard: CVSSv3.1:SUSE:CVE-2022-2127:5.9:(AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H)
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Comment 10 Robert Frohl 2023-07-19 15:59:07 UTC
===========================================================
== Subject:     Out-Of-Bounds read in winbind AUTH_CRAP
==
== CVE ID#:     CVE-2022-2127
==
== Versions:    All versions up to 4.18.4, 4.17.9 and 4.16.10.
==
== Summary:     When winbind is used for NTLM
   	            authentication, a maliciously crafted
	            request can trigger an out-of-bounds read
	            in winbind and possibly crash it.
===========================================================

===========
Description
===========

When doing NTLM authentication, the client sends replies to
cryptographic challenges back to the server. These replies
have variable length. Winbind did not properly bounds-check
the lan manager response length, which despite the lan
manager version no longer being used is still part of the
protocol.

If the system is running Samba's ntlm_auth as authentication backend
for services like Squid (or a very unusual configuration with
FreeRADIUS), the vulnarebility is remotely exploitable

If not so configured, or to exploit this vulnerability locally, the
user must have access to the privileged winbindd UNIX domain
socket (a subdirectory with name 'winbindd_privileged' under "state
directory", as set in the smb.conf).

This access is normally only given so special system services like
Squid or FreeRADIUS, that use this feature.

==================
Patch Availability
==================

Patches addressing both these issues have been posted to:

    https://www.samba.org/samba/security/

Additionally, Samba 4.18.5, 4.17.10 and 4.16.11 have been issued
as security releases to correct the defect.  Samba administrators are
advised to upgrade to these releases or apply the patch as soon
as possible.

==================
CVSSv3 calculation
==================

A local exploit, for systems without ntlm_auth configured:

CVSS3.1:AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H (4.4)

The remote exploit With ntlm_auth configured:

CVSS3.1:AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (5.9)

==========
Workaround
==========

Delegated access to this facility is done via group ownership and
group membership.

The group owner of the 'winbindd_privileged' subfolder under the path
given by
 testparm -s /path/to/smb.conf --parameter-name='state directory'
can be changed to root, or the group members reduced, if the NTLM
authentication feature of tools like Squid and FreeRADIUS is not in
use.

The 0750 permissions must however be retained, as winbindd will
otherwise fail to start.

As reassurance, smbd will continue to use this feature and will
always access this path as root.

=======
Credits
=======

Found through a coverity finding, fixed by the Samba Team.

==========================================================
== Our Code, Our Bugs, Our Responsibility.
== The Samba Team
==========================================================

https://www.samba.org/samba/security/CVE-2022-2127.html
Comment 11 Maintenance Automation 2023-07-19 20:35:16 UTC
SUSE-SU-2023:2888-1: An update that solves four vulnerabilities and has one fix can now be installed.

Category: security (important)
Bug References: 1213171, 1213172, 1213173, 1213174, 1213384
CVE References: CVE-2022-2127, CVE-2023-34966, CVE-2023-34967, CVE-2023-34968
Sources used:
SUSE Linux Enterprise Server for SAP Applications 12 SP5 (src): samba-4.15.13+git.621.c8ae836ff82-3.85.1
SUSE Linux Enterprise High Availability Extension 12 SP5 (src): samba-4.15.13+git.621.c8ae836ff82-3.85.1
SUSE Linux Enterprise Software Development Kit 12 SP5 (src): samba-4.15.13+git.621.c8ae836ff82-3.85.1
SUSE Linux Enterprise High Performance Computing 12 SP5 (src): samba-4.15.13+git.621.c8ae836ff82-3.85.1
SUSE Linux Enterprise Server 12 SP5 (src): samba-4.15.13+git.621.c8ae836ff82-3.85.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 12 Maintenance Automation 2023-07-19 20:35:19 UTC
SUSE-SU-2023:2887-1: An update that solves one vulnerability and has one fix can now be installed.

Category: security (moderate)
Bug References: 1213174, 1213384
CVE References: CVE-2022-2127
Sources used:
SUSE OpenStack Cloud 9 (src): samba-4.6.16+git.393.97432483687-3.81.1
SUSE OpenStack Cloud Crowbar 9 (src): samba-4.6.16+git.393.97432483687-3.81.1
SUSE Linux Enterprise Server for SAP Applications 12 SP4 (src): samba-4.6.16+git.393.97432483687-3.81.1
SUSE Linux Enterprise High Availability Extension 12 SP4 (src): samba-4.6.16+git.393.97432483687-3.81.1
SUSE Linux Enterprise Server 12 SP4 ESPOS 12-SP4 (src): samba-4.6.16+git.393.97432483687-3.81.1
SUSE Linux Enterprise Server 12 SP4 LTSS 12-SP4 (src): samba-4.6.16+git.393.97432483687-3.81.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 13 Maintenance Automation 2023-07-28 20:30:18 UTC
SUSE-SU-2023:3017-1: An update that solves one vulnerability and has one fix can now be installed.

Category: security (moderate)
Bug References: 1213174, 1213384
CVE References: CVE-2022-2127
Sources used:
openSUSE Leap 15.4 (src): samba-4.9.5+git.564.996810ca1e3-150100.3.82.3
SUSE Linux Enterprise High Availability Extension 15 SP1 (src): samba-4.9.5+git.564.996810ca1e3-150100.3.82.3
SUSE Linux Enterprise High Performance Computing 15 SP1 LTSS 15-SP1 (src): samba-4.9.5+git.564.996810ca1e3-150100.3.82.3
SUSE Linux Enterprise Server 15 SP1 LTSS 15-SP1 (src): samba-4.9.5+git.564.996810ca1e3-150100.3.82.3
SUSE Linux Enterprise Server for SAP Applications 15 SP1 (src): samba-4.9.5+git.564.996810ca1e3-150100.3.82.3
SUSE CaaS Platform 4.0 (src): samba-4.9.5+git.564.996810ca1e3-150100.3.82.3

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 14 Maintenance Automation 2023-07-31 12:30:14 UTC
SUSE-SU-2023:3060-1: An update that solves four vulnerabilities and has one fix can now be installed.

Category: security (important)
Bug References: 1213171, 1213172, 1213173, 1213174, 1213384
CVE References: CVE-2022-2127, CVE-2023-34966, CVE-2023-34967, CVE-2023-34968
Sources used:
SUSE Enterprise Storage 7.1 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Linux Enterprise Micro 5.2 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Linux Enterprise Micro for Rancher 5.2 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Linux Enterprise High Availability Extension 15 SP3 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Linux Enterprise High Performance Computing ESPOS 15 SP3 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Linux Enterprise High Performance Computing LTSS 15 SP3 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Linux Enterprise Real Time 15 SP3 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Linux Enterprise Server 15 SP3 LTSS 15-SP3 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Linux Enterprise Server for SAP Applications 15 SP3 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Manager Proxy 4.2 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Manager Retail Branch Server 4.2 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5
SUSE Manager Server 4.2 (src): samba-4.15.13+git.663.9c654e06cdb-150300.3.57.5

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 15 Maintenance Automation 2023-07-31 16:30:12 UTC
SUSE-SU-2023:3066-1: An update that solves four vulnerabilities and has one fix can now be installed.

Category: security (important)
Bug References: 1213171, 1213172, 1213173, 1213174, 1213384
CVE References: CVE-2022-2127, CVE-2023-34966, CVE-2023-34967, CVE-2023-34968
Sources used:
SUSE Enterprise Storage 7 (src): samba-4.13.13+git.643.8caa136952b-150200.3.26.3

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 16 Maintenance Automation 2023-08-18 12:30:03 UTC
SUSE-SU-2023:3358-1: An update that solves one vulnerability and has one fix can now be installed.

Category: security (moderate)
Bug References: 1213174, 1213384
CVE References: CVE-2022-2127
Sources used:
openSUSE Leap 15.4 (src): samba-4.11.14+git.396.91f4f677472-150200.4.52.5
SUSE Linux Enterprise High Availability Extension 15 SP2 (src): samba-4.11.14+git.396.91f4f677472-150200.4.52.5
SUSE Linux Enterprise High Performance Computing 15 SP2 LTSS 15-SP2 (src): samba-4.11.14+git.396.91f4f677472-150200.4.52.5
SUSE Linux Enterprise Server 15 SP2 LTSS 15-SP2 (src): samba-4.11.14+git.396.91f4f677472-150200.4.52.5
SUSE Linux Enterprise Server for SAP Applications 15 SP2 (src): samba-4.11.14+git.396.91f4f677472-150200.4.52.5
SUSE Enterprise Storage 7 (src): samba-4.11.14+git.396.91f4f677472-150200.4.52.5

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 18 Samuel Cabrero 2023-09-27 07:45:50 UTC
Reassigned to security team to close it.
Comment 20 Maintenance Automation 2024-02-27 12:30:30 UTC
SUSE-SU-2023:2929-1: An update that solves six vulnerabilities and has two security fixes can now be installed.

Category: security (important)
Bug References: 1212375, 1213170, 1213171, 1213172, 1213173, 1213174, 1213384, 1213386
CVE References: CVE-2020-25720, CVE-2022-2127, CVE-2023-3347, CVE-2023-34966, CVE-2023-34967, CVE-2023-34968
Sources used:
openSUSE Leap 15.5 (src): samba-4.17.9+git.367.dae41ffdd1f-150500.3.5.1
Basesystem Module 15-SP5 (src): samba-4.17.9+git.367.dae41ffdd1f-150500.3.5.1
SUSE Linux Enterprise High Availability Extension 15 SP5 (src): samba-4.17.9+git.367.dae41ffdd1f-150500.3.5.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 21 Maintenance Automation 2024-02-27 12:30:33 UTC
SUSE-SU-2023:2930-1: An update that solves four vulnerabilities and has one security fix can now be installed.

Category: security (important)
Bug References: 1213171, 1213172, 1213173, 1213174, 1213384
CVE References: CVE-2022-2127, CVE-2023-34966, CVE-2023-34967, CVE-2023-34968
Sources used:
openSUSE Leap 15.4 (src): samba-4.15.13+git.663.9c654e06cdb-150400.3.28.1
openSUSE Leap Micro 5.3 (src): samba-4.15.13+git.663.9c654e06cdb-150400.3.28.1
openSUSE Leap Micro 5.4 (src): samba-4.15.13+git.663.9c654e06cdb-150400.3.28.1
SUSE Linux Enterprise Micro for Rancher 5.3 (src): samba-4.15.13+git.663.9c654e06cdb-150400.3.28.1
SUSE Linux Enterprise Micro 5.3 (src): samba-4.15.13+git.663.9c654e06cdb-150400.3.28.1
SUSE Linux Enterprise Micro for Rancher 5.4 (src): samba-4.15.13+git.663.9c654e06cdb-150400.3.28.1
SUSE Linux Enterprise Micro 5.4 (src): samba-4.15.13+git.663.9c654e06cdb-150400.3.28.1
Basesystem Module 15-SP4 (src): samba-4.15.13+git.663.9c654e06cdb-150400.3.28.1
SUSE Linux Enterprise High Availability Extension 15 SP4 (src): samba-4.15.13+git.663.9c654e06cdb-150400.3.28.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.