The vulnerability resides in the daemon systemd-resolved and can be triggered using a TCP payload, according to Ubuntu developer Chris Coulson.
This component can be tricked into allocating less memory than needed for a look-up. When the reply is bigger it overflows the buffer allowing an attacker to overwrite memory.
This would result in the process either crashing or it could allow for code execution remotely.
The error was introduced into the systemd code in June 2015 in version 223.
Many Linux distributions have adopted systemd as their default init system but some have not yet moved from the old SysV init system.
Ubuntu has released patches for its two most recent releases — 16.10 and 17.04 — to fix the issue.
Debian is yet to issue a fix, but has pointed out that systemd-resolved is not enabled by default in its latest release, Stretch. Older Debian releases like Jessie and Wheezy do not contain the vulnerable code.
Red Hat said the flaw did not affect versions of systemd shipped with Red Hat Enterprise Linux 7.