It is narrated from Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) recited Bara'ah on Friday while he (peace and blessings be upon him) was standing, reminding (the people) of the Days of Allah Almighty. Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) was in front of the Prophet (peace and blessings be upon him), and Sayyiduna Abu al-Darda' (may Allah be pleased with him) and Sayyiduna Abu Dharr (may Allah be pleased with him) were also present. One of the two of them nudged Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) and asked: "O Ubayy, when was this surah revealed? For I have not heard it before now." He signalled to him to be silent. When the people had finished (the prayer), he (the one who had asked) said: "I asked you when this surah was revealed, but you did not tell me." Sayyiduna Ubayy (may Allah be pleased with him) said: "You have gained nothing from your prayer today except the part in which you engaged in idle (useless) talk." Then I went to the Messenger of Allah (peace and blessings be upon him) and mentioned this to him (peace and blessings be upon him), and told him (peace and blessings be upon him) what Sayyiduna Ubayy (may Allah be pleased with him) had said, and he (peace and blessings be upon him) said: "Ubayy has spoken the truth."
Abu Bakr Muhammad bin Khuzaymah (may Allah have mercy on him) narrated it in his Sahih from Zakariyya bin Yahya bin Aban, from Abu Maryam.
Related hadith on this topic