Hello internals,

I should voice my opinion that such things like comparing two strings
starting with numbers and that they resolve to actual integer/float for
comparation is bad, really bad. That just defies the logic and yealds
absolutly unexpected results. I pride myself that i know the juggling rules
well, but I'm shocked by this to say the least...
In my opinion this should change no matter the BC breaks it will create,
this one affects security big time. It's good I actually hash my passwords
in the MySQL and not on the PHP side, but I have seen hash comparations
with == all the time. And now that this has been discussed in detail I
expect this to be used as an attack method grow wide.
07.05.2012 5:32 пользователь "Tjerk Anne Meesters" <datib...@php.net>
написал:

> On Sun, May 6, 2012 at 12:17 AM, Richard Lynch <c...@l-i-e.com> wrote:
> >> What exactly valid points? == is a converting operator, === is a
> >> strict
> >> operator. OK, in his favorite language it is not. Where exactly the
> >> valid point is? Author goes at great lengths to refuse to make even a
> >> slight mental effort to understand how it works (really, it's not that
> >> hard) and then complains it's "useless". Well, a lot of things would
> >> be
> >> useless if you don't want to know how to use them.
> >
> > He has a few valid points in the part I read before I got bored...
> >
> > $a = "123ABF453..."; //a password
> > $b = "123DFEABC..."; //another one
> > if ($a == $b){
> >  //you're in.
> > }
> >
> > Yes, one should have validated the input...
> >
> > But you don't have to be THAT naive to think that the hashed value of
> > an SQL injection attack just isn't going to work, so it's "safe"...
> >
> > I'll bet I have some of these in my (recent) code, for that matter.
> >
> > On the other hand, if you accept type juggling, you have to expect the
> > other cases he has for == being a bit strange.
>
> Validated or not, why would type juggling even come into the picture
> if both variables are of the same type?
>
> 123 == "123abc" // sure, why not
> "61529519452809720693702583126814" ==
> "61529519452809720000000000000000" // WAT?!
>
> In the above, only the first ~50% of an md5 hash has to be correct.
> This gets even worse for SHA256 hashes.
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to