Given Iran's record on human rights, he was most likely tortured into confessing.
There may be a high correlation between torture and confession, but (invoke meme that needs to die): "Correlation is not causation."
Yes, I think open-source it, make it clear that they don't own it, and make an agreement with them that any further work you do on it in company time is also open-sourced.
Anyway, never mind what they might or might not benefit from it, the most important thing is how YOU are benefitting from it.
My approach is to put in my best, even if I am underpaid, because pushing your own limits, you increase your own capabilities. Compare this to some slacker who puts in the minimum and never improves. So having increased your own capabilities and also accumulated a load more selling-points on your CV, you're in a much better position to get a better job or to negotiate a better salary.
So you think that money is the root of all evil. Have you ever asked what is the root of money? -- Ayn Rand