Bug in MsgPluslive.net voting - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: General (/forumdisplay.php?fid=11) +---- Forum: Forum & Website (/forumdisplay.php?fid=13) +----- Thread: Bug in MsgPluslive.net voting (/showthread.php?tid=64646) Bug in MsgPluslive.net voting by leachy08 on 08-08-2006 at 11:40 AM
You have a bug in the voting system... RE: Bug in MsgPluslive.net voting by Menthix on 08-08-2006 at 11:54 AM Just mailed you, thank you in advance . RE: Bug in MsgPluslive.net voting by leachy08 on 08-08-2006 at 02:27 PM You've got mail RE: Bug in MsgPluslive.net voting by Menthix on 08-08-2006 at 10:27 PM Thank you. I saw it, will work on a solution tomorrow. Since people already started exploiting it and there is no real security risk I'll rather work on a good fix tomorrow than a quick fix now. RE: Bug in MsgPluslive.net voting by leachy08 on 08-09-2006 at 07:50 AM
lol i seen a few then at top of highest votes with 362/5 lol RE: Bug in MsgPluslive.net voting by John Anderton on 08-09-2006 at 08:33 AM
Is it the one where the cookie stops you from revoting so by deleting you can re-vote then i guess anyone could have figured it out. Ip log per vote per script isnt feasible plus even that is easy to get by quote:O.o! RE: Bug in MsgPluslive.net voting by leachy08 on 08-09-2006 at 08:52 AM nope its not. There's an exploit in the actual code of the voting. There is no check on the value that is being passed to the script. Therefore the user can send a vote of 1,000,000 instead of 5 if they wanted to. RE: Bug in MsgPluslive.net voting by NiteMare on 08-09-2006 at 10:57 AM ok, so all he has to do is fix the security flaw, then write a mini script to delete any vote thats not between 0 and 5 RE: Bug in MsgPluslive.net voting by Menthix on 08-09-2006 at 11:10 AM
quote:Votes aren't stored that way... There is total rating (which is a sum of all ratings given) and there is a ammount of people who voted. So total rating / ammount of people who voted = rating. RE: Bug in MsgPluslive.net voting by leachy08 on 08-09-2006 at 12:44 PM
Ahh so you will need to find each vote which is corrupt and clear it. I know id80 need clearing cuz thats mine i tested it on. To fix the flaw is easy though simple if statement... code: RE: Bug in MsgPluslive.net voting by Menthix on 08-09-2006 at 01:47 PM
quote:I have just reset all votes on all IDs because they were all messed up (somebody was probably bored). quote:I used that as fix before I saw your post, but found out you could still mess with floating values (like 3.5) that way which somehow messes it up too. It's now fixed so only 1,2,3,4 and 5 are allowed values. RE: Bug in MsgPluslive.net voting by leachy08 on 08-09-2006 at 02:03 PM
I was going to add that but thought that it may have already been handled. code: RE: Bug in MsgPluslive.net voting by Menthix on 08-09-2006 at 02:19 PM
quote:Thought about that too, but PHP documentation says: quote:and is_numeric() says: quote:...So I'm just hard checking for 1,2,3,4 or 5 now. There is probably a prettier solution, but this will do the job . I reported it to PHP Arena too BTW: (security) flaw in version 3.5.3 voting code @ paFileDB Forums. RE: Bug in MsgPluslive.net voting by leachy08 on 08-09-2006 at 02:37 PM
intval RE: Bug in MsgPluslive.net voting by Menthix on 08-09-2006 at 07:50 PM
Everything should be fixed now (it was already a few hours ago, but i tweaked it some more). quote:I agree it's easy to get by, but I still added this extra "security", it's at least something . Because I already saw somebody trying to get his script high in top ratings this way right after I reset votes . RE: Bug in MsgPluslive.net voting by leachy08 on 08-10-2006 at 07:59 AM
You should just store 1 vote as one record in mysql. This will slow things down but shouldnt be that bad. Then this would be near enough impossible to break. RE: Bug in MsgPluslive.net voting by RaceProUK on 08-10-2006 at 08:50 AM
quote:It will be that bad. Imagine, a few months down the line, several thousand votes have been cast. The query will take far longer to run than collecting all votes into a single record per script. quote:SELECT DISTINCT should only be used where necessary, as again it can slow queries down considerably. Again, with several thousand downloads, maybe even tens or hundreds of thousands, the size of the recordset makes SELECT DISTINCT impractical. RE: Bug in MsgPluslive.net voting by leachy08 on 08-10-2006 at 09:13 AM
I work at Co-Op bank and i run queries with just uner 1 million records at a time and are usually reuturned within in a few seconds on a normal windows nt box. Therefore on a server like this one this will not be a problem. code:This would be the best option. RE: Bug in MsgPluslive.net voting by RaceProUK on 08-10-2006 at 09:53 AM
quote:Ah, but how many concurrent users? That's also important. RE: Bug in MsgPluslive.net voting by leachy08 on 08-10-2006 at 10:13 AM just been thinking about what i said. Man i was tired complete nonesense. The recordset is nearly a million but i do not cycle through it and add values in a running total. That would totally screw the server load up silly me RE: Bug in MsgPluslive.net voting by Menthix on 08-10-2006 at 11:48 AM
quote:That's exactly what i've done (same for sownloads), I just don't see a good reason to store those records for a long time... What if the IP is dynamic and somebody else gets the IP and wants to vote too? And like RaceProUK says, building up a huge ammount of records will eventually slow things down. |