Imam Al-Nawawi’s Riyad-us-Saliheen
Chapter 351
Prohibition of Relieving Nature on the Paths
Allah, the Exalted, says:
“And those who annoy believing men and women undeservedly, they bear (on themselves) the crime of slander and plain sin.” (33:58)
1771. Abu Hurairah (May Allah be pleased with him) said: The Messenger of Allah (sallallaahu alayhi wa sallam) said, “Avoid two habits which provoke cursing.” The Companions said: “What are those things which provoke cursing?” He said, “Relieving on the thoroughfares or under the shades where people take shelter and rest.”
[Muslim].