I note that you've gotten your answer from the comments, but I will chime in and create a proper answer to this question.
a CDN works just like a regular hosting company. You pay for diskspace, and the CDN makes sure the content you upload is available to you, and often distributed around the globe for faster access. Anyone who has the cash can register and upload their files on a CDN. Some even accept payment in Bitcoin, making it much less of a risk uploading malicious files.
CDNs rarely do any content filtering, and I would guess that very few do any proactive screening of the files uploaded. How should the CDN know if the uploaded file is malicious? One mans JavaScript may not differ to much from that of another, but one of them could be used with malicious intent while the other one just provide a slider for a blog. It's impossible to know for sure!
If you ever experience malware hosted on a CDN, you could send them an email to have it removed/flagged. (Like what MaxCDN does) But there is no guarantee that X CDN will remove it, and if they do, it might even be too late!
You could make a whitelist of well-known CDNs, that you know take quick actions regarding hosted malware, and that might protect you a little (and it's certainly better than nothing!). But this is no guarantee, and I would suggest adding additional software/hardware to protect against malicious intent, and not just a whitelist.