مِشْكَاةُ الْمَصَابِيحِ
Mishkat al-Masabih 355
Purification
How to act when relieving oneself - Section 2
وَعَنْ مُعَاذٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: اتَّقُوا الْمَلَاعِنَ الثَّلَاثَةَ: الْبَرَازَ فِي الْمَوَارِدِ وَقَارِعَةِ الطَّرِيقِ وَالظِّلِّ . رَوَاهُ أَبُو دَاوُد وَابْن مَاجَه
Mu'adh reported God's messenger as saying, "Guard against the three things which produce cursing: relieving oneself in watering-places, in the middle of the road, and in the shade.” Abu Dawud and Ibn Majah transmitted it.
Mishkat al-Masabih, 355ضَعِيف (الألباني)