netatalk.io

Netatalk Security Advisory

Subject
afpd daemon vulnerable to type confusion
CVE ID
CVE-2023-42464
Date of Publishing
2023/09/17
Affected Versions
Netatalk 3.1.0 through 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.

Patch Availability

A patch addressing this vulnerability has been published at: https://github.com/Netatalk/netatalk/commit/a0ee3c246ee9e082436192290610a4d812fc0b7f.diff

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.

CVSSv3 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

Credits to finding and demonstrating the exploit goes to:

Florent Saudel, Arnaud Gatignol of @thalium_team

Patch by Daniel Markstedt of the Netatalk Team, based on work by Ralph Boehme of the Samba Team.