Sahih Muslim Book 1, Hadith Number 120.

Chapter : The condition of the Faith of one who knowingly denies his true fatherhood.

It is reported on the authority of Sa’d b. Abi Waqqas: Both of my ears heard the Messenger of Allah saying this: He who claimed the fatherhood of anyone else besides his real father knowingly (committed a great sin);Paradise is forbidden to him. Abu Bakra asserted that he too heard it from the Messenger of Allah (may peace be upon him).