netatalk.io

Netatalk Security Advisory

Subject
afpd daemon vulnerable to type confusion
CVE ID
CVE-2023-42464
Date of Publishing
2023/09/17
Affected Netatalk Versions
3.1.0 - 3.1.16
Summary
A Type Confusion vulnerability was found in the Spotlight RPC functions in Netatalk's afpd daemon.

Description

A Type Confusion vulnerability was found in the Spotlight RPC functions in Netatalk's afpd daemon. When parsing Spotlight RPC packets, one encoded data structure is a key-value style dictionary where the keys are character strings, and the values can be any of the supported types in the underlying protocol. Due to a lack of type checking in callers of the dalloc_value_for_key() function, which returns the object associated with a key, a malicious actor may be able to fully control the value of the pointer and theoretically achieve Remote Code Execution on the host.

The underlying code for Spotlight queries in Netatalk shares a common heritage with Samba, and hence the root cause and fix are logically identical with those described in CVE-2023-34967.

The vulnerable code was introduced in Netatalk 3.1.0, together with the Spotlight feature.

Patch Availability

Apply the patch with git hash a0ee3c2 to hotfix your local Netatalk deployment.

Additionally, Netatalk 3.1.17 has been released which contains the security patch. Netatalk administrators are advised to upgrade to this version or apply the patch as soon as possible.

CVSS Calculation

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L (5.3)

Workaround

Spotlight is an optional feature in Netatalk, and is disabled by default. If you previously enabled Spotlight and want to disable it, set "spotlight = no" in your afp.conf.

Credits

Vulnerability found and reported by:
Florent Saudel, Arnaud Gatignol of @thalium_team
Patch developed by:
Daniel Markstedt of the Netatalk team