Allah the Exalted said:
٣٥١ - باب النهي عن التغوط في طريق الناس وظلهم وموارد الماء ونحوها
Allah the Exalted said:
And those who harm believing men and believing women for [something] other than what they have earned [i.e., deserved] have certainly borne upon themselves a slander and manifest sin.
Abū Hurayra (may Allah be pleased with him) reported that the Messenger of Allah ﷺ said: "Beware of the two cursers." They said: What are the two cursers? He said: "The one who relieves himself in people's path or in their shade." Narrated by Muslim.