The Imams (a.s.) inherited the knowledge of the Holy prophet (s.a.) and all the prophets and their successors before them

Al-Kāfi|Volume 1|Book 4|Chapter 33