The Prophet ﷺ said: He who is asked something he knows and conceals it will have a bridle of fire put on him on the Day of Resurrection. (Using translation from Abū Dāʾūd 3658)
عَنِ النَّبِيِّ ﷺ قَالَ مَنْ سُئِلَ عَنْ عِلْمٍ فَكَتَمَهُ أَلْجَمَهُ اللهُ ﷻ بِلِجَامٍ مِنْ نَارٍ يَوْمَ الْقِيَامَةِ