The following is a translation from Arabic.
The Shariah Qa'ida (principle) states: 'The means to Haram is forbidden if it were established with the least amount of doubt that it would lead to Haram. If it were merely feared that it would lead to Haram, it would not be Haram'.
The evidence for this principle is reflected in Allah (swt)’s saying: "Do nor revile those who call upon other than Allah lest they out of spite revile Allah in their ignorance." [TMQ 6: 108] insulting the Kuffar is Mubah (permissible), and Allah (swt) has insulted them in the Qur'an. However, if this insult were to lead to the Kuffar insulting Allah (swt), it would become Haram. This is so because insulting Allah (swt) is forbidden. This is how the Shari'ah principle has been deduced, that is: “The means to Haram is forbidden.” However, this means becomes Haram if it led inevitably to Haram. In other words, if such a means were to lead, with the least amount of doubt, to Haram, and if this Haram has been established by Shari'ah, it would become Haram. Therefore, if the means did not lead to Haram, i.e. if it were only feared that it might lead to Haram, such as the outing of a woman without a face cover, where it is feared that it might cause Fitna, the means in this case would not be Haram, because the mere fear that it might lead to Haram is not sufficient to warrant a prohibition. This is the evidence of this principle.
Another similar principle to this one is the following principle: “If one specific item of a Mubah thing leads to harm, that particular item becomes Haram and the thing remains Mubah.”
This is reflected in what Bukhari reported on the authority of Nafi’ who said that Abdullah Ibnu Omar informed him: “People came with the Messenger of Allah (saw) to the land of Thamud Al-Hijr; so they took water from its well and made dough with it. The Messenger of Allah (saw) ordered them to spill the water and to give the dough to the animals; he then ordered them to take water from the well which the she camel used to drink from.”
In another narration, the Messenger of Allah (saw) said: “Do not drink anything from its water and do not used that water to make ablution for Salat, whatever dough that you prepared, give to the animals and do not eat anything from it. None of you should go out at night unless he has a companion with him.”
Drinking water is Mubah, but that particular water, that is the water of Thamud, has been made prohibited by the Messenger of Allah (saw) because it led to harm; however, water in general remained Mubah. Also, it is Mubah for a person to go out at night without a companion, but the Messenger of Allah (saw) prohibited anyone from among that army, in that particular night and at that particular place, from going out because it led to harm; apart from this, going out at night without a companion remained Mubah. This serves as evidence that a particular item of the Mubah thing becomes Haram if it led to harm, and the thing in general remains Mubah.