All perfect praise be to Allah, The Lord of The Worlds; and may His blessings and peace be upon our Prophet Mohammad and his companions.
In principle, affiliate contracts such as mortgage and Kafalah(a pledge to present a debtor to pay his/her debt) aren`t concluded before the main contract, as is the case with debt in commutative contracts and the interest-free loans. Al-Imam Anawawi said; "It is conditioned that the mortgaged object is a debt claimed from the mortgagee."{Minhajj Attalibeen, P.115}.
On their part, the Maliki jurists and some of the Hanbali jurists permitted mortgaging an object before concluding its contract, as stated in the book: {Ash-sharh As`sagheer, P.115}, "Mortgaging an object is permissible before claiming the debt from the mortgagee."
According to Ibn Qoudamah, there are three cases as far as mortgage is concerned:
First: It is conducted after concluding the sale contract; therefore, it becomes valid by consensus of the Muslim scholars.
Second: It is conducted along with the contract in which the debt is claimed. In this case, it is considered valid, and this is the view of Imam Malik and Al-Shafie`.
Third: The object is mortgaged before the conclusion of its contract.
Here, the preponderant opinion of the Hanbali jurists is that it is invalid, and this is the view of Al-Shafie as well. Abu Al-Khattab decided that it is valid.{Al-Moghni by Ibn Qoudamah 4/246}. And Allah knows best.