Praise be to Allah.
There is nothing wrong with a fasting person rinsing his or her mouth with water, or with water and salt, especially if there is a need to do that, such as reducing pain etc, subject to the condition that he be very careful not to let anything reach the stomach. If anything reaches the stomach by mistake, there is no sin on him and his fast is still valid.
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said: “If a gnat flies into the mouth of a fasting person or something enters his mouth without him wanting it to, or he rinses his mouth or nose and some water enters his stomach without him meaning it to, then his fast is still valid and he does not have to make it up.”
Majaalis Shahr Ramadaan, 15.
And Allaah knows best.
And he was asked about rinsing the mouth when it is very hot – does that invalidate the fast?
He replied: The fast is not invalidated by that, because the mouth comes under the same ruling as the outside of the body. Hence the fasting person may rinse his mouth whilst fasting and that does not break his fast. Moreover rinsing the mouth is obligatory in wudoo’, so if the mouth did not come under the same ruling as the outside of the body, washing it would not be obligatory in wudoo’. And rinsing the mouth when it becomes dry because of intense heat is something that makes fasting easier. It was narrated that the Prophet (peace and blessings of Allaah be upon him) used to pour water over his head because of thirst if it was intensely hot when he was fasting. This was narrated by Abu Dawood (2365) and classed as saheeh by al-Albaani.
Ibn ‘Umar (may Allaah be pleased with him) used to soak his garment and put it on when fasting, to cool himself down. And Anas ibn Maalik (may Allaah be pleased with him) had a cistern which he would fill with water and bathe in it when he was fasting. All of this indicates that doing things to make fasting easier for a person is permissible and there is no sin in it. But the one who rinses his mouth should be careful to avoid letting the water reach his stomach because that is a serious matter. But if water reaches his stomach in this case without him meaning it to, then there is nothing wrong with that.
Majmoo’ al-Fataawa, 19.
The two reports from Ibn ‘Umar and Anas were narrated by al-Bukhaari in a mu’allaq report in his Saheeh.
See also the answer to question no. 38907.