سَعِيدٌ قَالَ: نا هُشَيْمٌ، قَالَ: أنا طَلْحَةُ أَبُو مُحَمَّدٍ مَوْلَى بَاهِلَةَ قَالَ: نا قَتَادَةُ، عَنْ شَهْرِ بْنِ حَوْشَبٍ، عَنْ عَمْرِو بْنِ خَارِجَةَ الْأَشْعَرِيِّ قَالَ: شَهِدْتُ مَعَ رَسُولِ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ حَجَّتَهُ. فَقَالَ: إِنِّي لَبَيْنَ جِرَانِ نَاقَةِ رَسُولِ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ وَهِيَ تَقْصَعُ بِجِرَّتِهَا، وَلُعَابُهَا يَسِيلُ بَيْنَ كَتِفَيَّ. قَالَ: فَسَمِعْتُهُ يَقُولُ: «إِنَّ اللَّهَ قَدْ أَعْطَى كُلَّ ذِي حَقٍّ حَقَّهُ؛ وَلَا تَجُوزُ وَصِيَّةٌ لِوَارِثٍ، أَلَا وَإِنَّ الْوَلَدَ لِلْفِرَاشِ وَلِلْعَاهِرِ الْحَجَرُ، أَلَا مَنِ ادَّعَى إِلَى غَيْرِ أَبِيهِ أَوِ انْتَمَى إِلَى غَيْرِ مَوَالِيهِ فَعَلَيْهِ لَعْنَةُ اللَّهِ وَالْمَلَائِكَةِ وَالنَّاسِ أَجْمَعِينَ، لَا يُقْبَلُ مِنْهُ صَرْفٌ وَلَا عَدْلٌ»
Amr bin Kharijah Ash'ari (may Allah be pleased with him) narrates that I heard the Messenger of Allah (peace and blessings be upon him) say during the Farewell Pilgrimage: "Allah has given every rightful person his due right, therefore, it is not permissible to make a bequest in favor of an heir. The child belongs to the (owner of the) bed, and for the adulterer is the stone. Whoever attributes himself to someone other than his father, or affiliates himself to other than his own clients, upon him is the curse of Allah, the angels, and all people, and neither any voluntary nor obligatory act will be accepted from him."
Brief Explanation
Shahr ibn Hawshab: He is prone to many errors; if not corroborated, he is weak. Talhah Abu Muhammad: His condition is unknown (this is a flaw in the first part of the narration).
And it has supporting narrations from the hadith of Ali ibn Abi Talib. As for the hadith of Ali ibn Abi Talib, «أخرجه البخاري فى «صحيحه» no. 1870, 3172, 3179, 6755, 7300, and Muslim in «صحيحه» no. 1370.