The Messenger of Allah ﷺ said, "Whoever is asked about knowledge and conceals it will come on the Day of Resurrection bridled with a bridle of fire."
حدثنا يزيد أخبرنا الحجاج بن أرطاة عن عطاء
قال رسول الله ﷺ من سئل عن علم فكتمه جاء يوم القيامة ملجما بلجام من نار
Its isnad is sahih. It has already been mentioned with another sahih isnad at 7561, narrated by Hammad bin Salama from Ali bin Hakam, from Ataa. We discussed its sourcing in detail there and pointed to this version.