Dawud bin Ali narrates from his father, and he from his grandfather (may Allah be pleased with him), that the Messenger of Allah (peace and blessings be upon him) said: "The child born of fornication is the worst of the three, when he does the deeds of his parents."
This chain is weak, and the one before it is not strong; these words are only narrated, as an explanation of the report, as the saying of Sufyan al-Thawri.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19994