There exists a Moon Treaty, but this is only signed and ratified by 16 countries, none of them capable of space travel. India is a signatory, and now has its own space program, but has not ratified it. Even though treaties exist, the UN has no overruling power over independent nations, thus making the actual relevance of the treaty disputable.
The Moon Treaty does not strictly ban commercial use of Lunar resources, but it is likelyinsufficient to be used asactually provide a good framework for regulating them if the issue comesturns up. When Lunar resource harvesting is becoming a reality, it must be replaced with a more solid international agreement.
Together with many other fields of space law, there are a lot of ambiguity and untested cases related to the Moon treaty. It may not be possible to determine if the treaty would hold in the case of a dispute, being hugely dependent on international politics.