How to filter URLs for embedded IMG tags?
If you mean disallowing &lt;img&gt; elements where the src isn't on a whitelist, then you can make a custom input filter.

The first step is to make a hook_filter_info to declare your input filter.  You would then make a callback function that does the work.

The callback would do some regex matching, looking for &lt;img&gt; elements and pulling out the src attributes.  Then regex match the src against your whitelisted domains.  If everything is OK, let the image pass, else replace it with whitespace.

Finally, make a hook_menu which sets up a settings page so you can enter your whitelist via the UI.

Once you have done all of this, you add your filter to the appropriate input formats.  When the page gets rendered out, the filter will be applied.

All of this is rather easy.  The heavy listing is the &lt;img&gt; regex, but I suspect 15 min of googling will find some good ones.