Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Beware of the two acts that bring curses."Someone asked, "Messenger of Allah, what are the two acts that bring curses?"He replied, "Relieving oneself on the people's pathways or in the shade where they rest."

Azami 1419

Sahih

عن أبي هريرة قال

قال رسول الله ﷺ: اتقوا اللعانين. قيل وما اللعانان يا رسول الله؟ قال: الذي يتخلى في طريق الناس أو في ظلهم.

الأعظمي 1419صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Purification
Section
Places where urinating and defecating are prohibited
Numbering
Jami al-Kamil 1419 (2nd edition)
Azami 1419