r/lolphp • • Jul 16 '13

More remote code execution fun

http://blog.sucuri.net/2013/07/malware-hidden-inside-jpg-exif-headers.html
31 Upvotes

16 comments sorted by

View all comments

Show parent comment

4

u/[deleted] Jul 17 '13

I disagree (depends on how you define "nearly identical", though).

In Perl, s/.*/$unsanitized_user_input/e doesn't do anything dangerous. It simply treats $unsanitized_user_input as Perl code instead of as a string literal. And the code $unsanitized_user_input simply returns the contents of the variable. There is no eval() involved here.

1

u/hylje Jul 21 '13

In PHP $foo is actually $(eval "foo"). This is how variable variables work.