It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that he said: "Whoever attributes himself to someone other than his real parents, or takes as his patrons someone other than the masters who freed him, upon him is the curse of Allah and the angels until the Day of Resurrection; neither an obligatory deed nor a voluntary deed will be accepted from him."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12955