Yes, it is illegal for unpaid interns to do ANY work that has actual value to the business. Full stop. Unpaid interns are supposed to be about the company giving back to the local community and providing training and the laws are such that if they perform work that is used by the business in any way, the business is breaking the law.
So whatever the interns build is supposed to go unused? What if they build something open source and the company uses it?
My guess would be the intern owns it.
This is why many internships are paid, even at minimum wage.