Open source is by definition legal to modify and spread. There is a number of open source compatible licenses.
Leaked source is just that. Leaked.