The Outer Space Treaty may say that but back in 2015 the United States said it will allow US corporations to keep and sell what they mine in space. So it will be interesting to see how it actually plays out.
[0] https://www.congress.gov/bill/114th-congress/house-bill/2262 [1] https://motherboard.vice.com/en_us/article/ezp4yk/the-us-say... [2] https://www.planetaryresources.com/2015/11/president-obama-s...