Praise be to Allah, The Lord of the Worlds; may His blessings and peace be upon our Prophet Mohammad and upon all his family and companions.
Islam urged Muslims to expend from the good things they earned to preserve their health and forbade seeking the corrupt things either for expending or for trading. This is because Allah Says (What means): "O you who believe, expend of the good things you have earned, and of what We have produced for you from the earth, and seek not the corrupt of it for your expending." [Al-Baqarah/267]. Ibn Katheer commented on this verse where he said (What means): "One should expend from the good things; not the corrupt." [Tafseer Ibn Katheer, vol.1/pp. 697].
One of the Islamic legal maxims in this regard is that harm (Darar) must be removed/eliminated because the Prophet (PBUH) said: "No injury/harm shall be inflicted or reciprocated" [Ahmad & Ibn Majah]. Obviously, the Prophet (PBUH) prohibited inflicting harm on others, be that on their health or life. A form of this prohibition is that it is banned selling expired or rotten foods to people or forge the date of production or expiry of such items to make profit.
If the trader knows that the foods have expired or are rotten, then it is prohibited to sell them to the people because they are mostly harmful. In addition, selling such foods is considered eating up people`s wealth unjustly. The proof of this is that Allah The Almighty Says (What means): "O you who believe, consume not your goods between you wrongly, except it be trading through mutual agreement. And kill not yourselves. Surely God is ever Merciful to you." [An-Nisa`/29]. Moreover, selling such foods is a form of deception since the Prophet (PBUH) said: "… He who deceives has nothing to do with me." [Moslim].
If these foods led to someone`s death and this was medically proven then, according to the apparent meaning of the scholars` view, the person who caused it has committed misconduct and this suffices as valid ground to pay compensation since this is like when someone gets harmed by stones thrown on a public road. In addition, deceiving customers by selling them rotten foods on the basis that they are not rotten nor expired is a form of deception.
In conclusion, it is the duty of every Muslim to be keen on the safety of others and avoid what may cause harm to them. Therefore, it is forbidden to sell them anything harmful and it is also forbidden to deceive them. However, if the trader knows that the products have expired and someone died as a result for consuming them while unaware that they have expired then the trader is liable of Diya (Blood money) and Kafarah (Expiation), because he has caused that. Similarly, the same ruling applies even if the seller doesn`t know that the product he sold has expired since it is his duty to check the date of expiry. Furthermore, the Muslim ruler or whoever represents him may apply a discretionary punishment on such trader as he sees fit. And Allah The Almighty Knows Best.