I'm not terribly familiar with Lua sandboxing, but a cursory overview suggests that absolutely nothing would prevent it from including similar nastiness if used in display code.
In any case, something like a website theme in any language, can always display HTML that is at least that hidden. So sure, kill base64_decode in php, but as long as you have a Turing-complete language which is at least moderately inevitable if you allow any logic in your templating system at all and you can implement the equivalent trivially.
If you completely neuter your templating system, then do something like include inline base 64 in CSS as image data, decode & exec using JS. Google's spiders will run JS now, unless I'm mistaken, so that's just as good from an SEO standpoint.
You're comparing apples and oranges here. You can run PHP in "safe mode", as many shared hosts do, to prevent shell access and disk access by PHP code.
The only problem here is one of misplaced trust (and perhaps WordPress allowing PHP in templates instead of using a dedicated templating language). People installing WordPress templates generally a) don't care where they come from and b) don't even read the source code, so this theme could probably include such links without any obfuscation and still successfully spread.
No, but the problem is that the spammy code is being obfuscated using eval() and base64 encoding.
> You can run PHP in "safe mode", as many shared hosts do, to prevent shell access and disk access by PHP code.
Sure, so why have other unsafe methods?
I agree that social attacks cannot be completely prevented through technical means, but there's no reason to make it easy.
edit: why the downvotes? Are these functions truly indispensable for this particular domain?
PHP is meant to be. OK, I'm cheating and saying how it ought to have been with the benefit of hindsight. But the next web language will hopefully take these experiences into account.
<script>......</script>
Nothing to do with the theme execution and still allows hiding code both via any encoding and via eval.Basically for printing out some text on the website, it doesn't matter whether you're running
<? echo eval($encrypted_code) ?>
on some php code or <script>eval(encrypted_code)</script>
in JS. The only thing it protects you from is local exploits, not adding content.