The Messenger of Allah ﷺ said, "People must stop raising their eyes toward the sky during supplication in prayer, or their sight will be snatched away."
أن رسول الله ﷺ قال: لينتهين أقوام عن رفعهم أبصارهم عند الدعاء في الصلاة إلى السماء، أو لتخطفن أبصارهم.
Muslim reported it in the Book of Prayer (429), from the hadith of Ibn Wahb, who said, "Layth bin Saad narrated to me, from Jafar bin Rabia, from Abdul-Rahman bin Aaraj, from Abu Hurairah," and he mentioned it.