The World Federation One Stop Fiqh

Ruling 2564

If a depositor and a depositee agree that the item deposited [as security] will be in the possession of the depositee or a third party, the depositor cannot take back the item before paying off his debt. If he does, he must return it immediately.