It is permissible to buy/sell products with a warranty for a specific length of time, and this comes under the heading of a promise or stipulating a benefit for the purchaser, both of which are permissible. It is also permissible to increase the price of the product in return for an increase in the length of the warranty.
However, with regard to selling separate warranty coverage, such as if a person buys a product without a warranty, or he buys it with a warranty that has ended, then he buys a new warranty for another period, this is not permissible, because this involves ambiguity and gambling. In this case he pays money for which he may or may not benefit from coverage. This comes under the heading of gambling, which is not permissible, and it is the principle on which commercial insurance is based.
The difference between increasing the price of the product in return for extending the warranty, and purchasing separate coverage, is that the warranty in the first instance is connected to the purchase of the product, and the basic principle is that things may be overlooked if they are connected to (and secondary to) a transaction in a way that is not applicable in other cases.
The scholars have stated that the ambiguity that is prohibited is that which has to do with the item that is the main subject of the transaction, not things that are connected to (and secondary to) that item. If the ambiguity has to do with the item that is the main subject of the transaction, such as selling crops before they ripen – as opposed to selling the trees themselves – in that case the transaction is invalid. However, if the ambiguity has to do with things that are connected to (and secondary to) the item that is the main subject of the transaction, then it does not affect the transaction, such as selling of the trees with the crops before they ripen, or selling something that has not yet grown along with that which is already there (in the case of crops), or selling the milk in the udder along with the female sheep – in all these cases, the ambiguity of all of these (secondary) things may be overlooked and it does not affect the transaction.