Executive brief
Zeroconf is a Python library used by smart home software and other applications to automatically discover devices on a local network. A flaw in how it handles network messages allows an attacker on the same local network to send specially crafted data that corrupts the library's internal cache. This could lead to applications receiving incorrect information about available devices or services, potentially disrupting operations or facilitating further attacks.
Technical details
A vulnerability exists in the `_read_character_string` and `_read_string` functions within `src/zeroconf/_protocol/incoming.py`. The parser advances the internal data offset by an attacker-declared `RDLENGTH` without verifying it against the actual remaining buffer length (`self._data_len`). Because Python's slicing mechanism silently returns fewer bytes when an index exceeds the buffer, the library constructs and caches truncated TXT, HINFO, or A/AAAA records before a subsequent parse error occurs. This allows unauthenticated adjacent attackers to perform cache poisoning and parser-state desynchronization. The issue is addressed in version 0.149.16 by implementing explicit bounds checks.
Affected products
- python-zeroconf zeroconf < 0.149.16
Timeline
- 2026-05-20: patched: Fix merged in PR #1756
- 2026-05-21: advisory: GHSA-qc2x-6f54-m6h9 published
- 2026-07-17: disclosed: CVE-2026-48487 published to NVD
References
- https://github.com/python-zeroconf/python-zeroconf/commit/544449596e645fcaad3834fa0cb614a54f847a82
- https://github.com/python-zeroconf/python-zeroconf/issues/1752
- https://github.com/python-zeroconf/python-zeroconf/pull/1756
- https://github.com/python-zeroconf/python-zeroconf/releases/tag/0.149.16
- https://github.com/python-zeroconf/python-zeroconf/security/advisories/GHSA-qc2x-6f54-m6h9