Go, Rafi, as my doorkeeper, to Ibn Abbas and say to him, "If every one of us is delighted with what he has been given and loves to be praised for what he has not done, then we shall all be punished."Ibn Abbas replied, "What have you to do with this verse? It was only revealed concerning the People of the Book."Then Ibn Abbas recited, "And remember when Allah took the covenant of those who were given the Scripture, that you must make it clear to the people" [Aal Imran 3:187], this verse.And Ibn Abbas recited, "Do not think that those who rejoice in what they have done and love to be praised for what they have not done" [Aal Imran 3:188].Ibn Abbas said, "The Prophet ﷺ asked them about something, and they concealed it from him and told him something else instead. They went out having shown him that they had answered what he asked, and they sought praise from him for that, and rejoiced in what they had done by concealing from him what he had asked them about."
حدثنا حجاج عن ابن جريج قال أخبرني ابن أبي مليكة أن حميد بن عبد الرحمن بن عوف أخبره أن
اذهب يا رافع لبوابه إلى ابن عباس فقل لئن كان كل امرئ منا فرح بما أوتي وأحب أن يحمد بما لم يفعل لنعذبن أجمعون فقال ابن عباس وما لكم وهذه إنما نزلت هذه في أهل الكتاب ثم تلا ابن عباس {وإذ أخذ الله ميثاق الذين أوتوا الكتاب لتبيننه للناس} هذه الآية وتلا ابن عباس {لا تحسبن الذين يفرحون بما أتوا ويحبون أن يحمدوا بما لم يفعلوا} وقال ابن عباس سألهم النبي ﷺ عن شيء فكتموه إياه وأخبروه بغيره فخرجوا قد أروه أن قد أخبروه بما سألهم عنه واستحمدوا بذلك إليه وفرحوا بما أتوا من كتمانهم إياه ما سألهم عنه
Its isnad is sahih. Ibn Kathir cited it in his Tafsir 2:316 from this passage, and said, "This is how Bukhari related it in his Tafsir, and Muslim, Tirmidhi, and Nasai in their Tafsirs, and Ibn Abu Hatim, Ibn Khuzayma, Hakim in his Mustadrak, and Ibn Mardawayh, all of them from the hadith of Abdul-Malik bin Jurayj, in similar wording." Bukhari related it from the hadith of Ibn Jurayj, from Ibn Abu Mulayka, from Alqama bin Waqqas, that Marwan said to his doorkeeper, "Go, Rafi, to Ibn Abbas," and he then narrated it. See Fath al-Bari 8:175–176.As for Marwan's statement, "bima uti" (for what he was given), this is how it appears in both original manuscripts and in Bukhari, while the verse reads "bima ataw" in both original manuscripts, and in Bukhari it appears as "bima utu". See the Sultaniyya edition 6:41–42. Qastallani said in 7:56, "According to Abu Dharr, from Mustamli and Kashmihani, it is 'bima utu'." The Hafiz mentioned in Fath al-Bari that "utu" is the reading of Sulami and Saeed bin Jubayr.