-2

I am creating a simple application. There is an option to download a generated image. For that, my PHP code is:

<?php
if (isset($_GET['img_name'])){
?>
<html>
<img src="<?php echo $_GET['img_name'];?> "></html>
<?php
}
?>

I know this is vulnerable to XSS. But this is not the problem. Question is, is it possible for attacker to include or execute PHP file or code via this application? I know that, for echo and img tag PHP will not execute here.

What you think researchers? Am I safe?

1

If your only concern is Code Execution, yes, you are safe.

But like you said, you are vulnerable to Cross Site Scripting. And depends on the purpose of your page, you could be vulnerable to IP leak and token stealing.

  • Not to mention Open Redirection, Built-in CSRF, and I'm sure a handful more vulns if I were to give it more than half a moment thought.... – AviD Dec 1 '14 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.