It is narrated from Sayyiduna Abu Sa'id (al-Khudri) (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Envy (ghibtah) is (permissible) only regarding two (people): a man to whom Allah has given the Qur'an and he recites it in the hours of the night and the hours of the day, so (another) man says: 'If I were given the like of what this man has been given, I would do as he does'; and a man to whom Allah has given wealth and he spends it in the way of what is right, so (another) says: 'If I were given the like of what this man has been given, I would do as he does.'"
Its origin is in the two Sahihs and elsewhere from the hadith of Sayyiduna Ibn Umar (may Allah be pleased with them both), and in Sahih al-Bukhari and elsewhere from the hadith of Sayyiduna Abu Hurayrah (may Allah be pleased with him). Here "envy (hasad)" means ghibtah (benign envy): that is, wishing for a blessing like that of the one envied, not wishing that the blessing be taken away from him, for that is the blameworthy envy.