There's this application whose official website requires that people provide their email and agree to a EULA before they send you a download link. The EULA forbids redistribution and publication of derivative work.
Still, you find many derivative versions of that application in GitHub projects, some of which have made essentially no changes, i.e. you can just download their ZIP and it's effectively like downloading the original app (and one can make it exactly like the original app by essentially removing a few new files). Some of these derivative versions have project license files, e.g. Apache License v2.
I have no idea how they got the code; but how legal is it to distribute something which derives from that code based on the claim that the code was obtained from publicly-accessible websites which published it under a relatively permissive license?
Edit: I actually misread the license, so now this example is actually theoretical.