Assalamu-Aleykoom, I was praying fajr prayer by myself (I missed the jama'a prayer) and while I was sitting, instead of saying the tahiyya I began reciting surat ilfatiha. Out of habit, I said astaghfirillah and then said the tahiya and continued from there until I finished the prayer. Is saying astaghfirillah in prayer during a sequence where there is no recitation of it okay? I have heard that saying a'oodhoo billah min alshaytan ilrajeem is okay, but I haven't heard the same about istighfar.
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Al-Faatihah and seeking forgiveness are among the words that are permissible to be said in the prayer.
What you had said while sitting in the Tashahhud is considered an addition that is part of the genre of the Prayer and it is a legislated mention but not in its proper place.
Saying this kind of addition in prayer does not invalidate it, whether it was done intentionally or inadvertently.
The scholars stated that if the statements are a form of mention of Allah in other than at their proper place, then this does not require anything.
Al-Fawaakih ad-Dawaani Sharh risaalat Ibn Abu Zayd al-Maaliki said:
“As regards the addition in the words of the prayer, then there is no prostration for forgetfulness and the prayer is not invalidated if they are said deliberately.”
Ibn Qudaamah said about an increase in the words of the prayer: “The second type: what does not invalidate the prayer if it is done deliberately: it is of two kinds: If one says a mention [Thikr] at other than at its proper place, such as reciting the Quran in the bowing down position [Rukoo’] or in the prostration [Sujood], or saying the Tashahhud while standing in prayer, or saying the salutations on the Prophet in the first Tashahhud, or reciting a Surah (Chapter of the Quran) in the last two Rak’ahs of the four Rak’ah prayers, or at the last Rak’ah of the Maghrib prayer, and the like,….because it was reported that the Prophet heard someone saying in the prayer: “Al-Hamdu lillah hamdan katheeran tayyiban mubaarakan feeh kama yuhibbu rabbana wa yardha” (Praised be to Allah with an abundant beautiful blessed praise, as our Lord likes and is pleased with); and he did not order him to prostrate for forgetfulness.” [End of quote]
Therefore, your prayer is valid –Allah willing –and you did not have to prostrate for forgetfulness.
Allah knows best.
You can search for fatwa through many choices