Some acquaintances of mine wished to invest in the stock market, so they bought stock exchange shares through a large company in the field of bill brokerage. However, some days ago they started to think about the validity of their act under Sharee'ah. They were not aware of the fact that such a company deals in securities of all companies, whether their activity is lawful in the Sharee'ah or not, and whether or not it deals in Riba (interest). Consequently, they regretted buying these shares and decided to sell them. However, they have two questions:
First: They decided to sell these shares once they became aware of the wrongful act of buying them even if such selling would result in loss if the price of the shares decreases. Should they take the profit if the price of the shares increases? Is such a profit an unlawful gain that they must get rid of?
Second: If they want to invest their money in the shares of the stock market in one of the companies whose activity is lawful such as cement companies; however, such companies take Riba-based loans; is it permissible to invest in these companies on the basis that their activity is lawful, or is it impermissible to invest in these companies on the basis of their Riba-based loans?
All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
We understood from your question that those people bought shares in a bill-brokerage company that does not adhere to the Sharee'ah in its dealings by being a broker for companies, whether they deal in Riba or unlawful activities or not.
Undoubtedly, buying shares in such companies which do not adhere to Sharee‘ah rules is unlawful because their work supports the occurrence of Riba and unlawful activities; Allaah Almighty says (what means): {but do not cooperate in sin and aggression.} [Quran 5:2] Whoever does so must repent to Allaah and seek His Forgiveness and withdraw from such companies by taking only his capital without any gains.
If the people running the company do not accept withdrawal and oblige the withdrawing person to sell the shares according to the current market price, then, there is a problem in this regard. If the person sells the shares, he helps others to get involved in what is unlawful. If he remains a shareholder, he remains involved in what is unlawful. So, what is the way out? The answer is that the person should continue in the company and give the amount of money which he believes to be gained from dealing in what is unlawful in charity.
Buying shares in the companies that conduct lawful activities but take Riba-based loans is impermissible because one of the conditions of buying shares in companies is that they do not give or take loans on the basis of Riba.
Allaah Knows best.
You can search for fatwa through many choices