Give Charity From What You Stole If You Don't Know the Rightful Owner
Question :
I wrongfully took things from people during the days of my ignorance, but now, I don't remember or don't know who they are. Returning those rights is from the requisites of repentance, so what should I do?
Answer:
If you don't know the people you stole from, or don't know who inherits from them if they are deceased, then give that wealth for charity on their behalf, with the intention of absolving yourself from the wrong you did. Allah Almighty knows who the wealth belongs to and He will reward them for that charity.
Source:
Ibn 'Uthaimin
Fatawa Islamiyah, Vol. 7 Page 246