Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Can't find exactly what you've been wanting? Try searching for what you are looking for in the search box to the right. ----------->


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: Secure Display Picture Uploading  (Read 1128 times)

Diesel

  • Basic Member
  • *
  • Reputation Power: 6
  • Diesel has no influence.
  • Offline Offline
  • Posts: 14
    • View Profile
Secure Display Picture Uploading
« on: November 09, 2009, 07:08:00 PM »
I have heard that the uploading display pictures form in preferences.php of mccodes v2 was vulnerable. I'm not familiar with security in the slightest bit, so I was wondering if someone else could post a quick patch to this. Thanks.
Logged

JoshuaDams

  • Active Member
  • **
  • Reputation Power: 129
  • JoshuaDams is working their way up.JoshuaDams is working their way up.JoshuaDams is working their way up.
  • Offline Offline
  • Posts: 240
    • MSN Messenger - immortalthug4ever@hotmail.com
    • View Profile
    • WWW
Re: Secure Display Picture Uploading
« Reply #1 on: November 09, 2009, 09:31:52 PM »
Quick Fix

mysql_real_escape_string($_POST['pic'])

Long fix is a bit more in depth :p

HauntedDawg

  • Basic Member
  • *
  • Reputation Power: 12
  • HauntedDawg has no influence.
  • Offline Offline
  • Posts: 25
    • View Profile
Re: Secure Display Picture Uploading
« Reply #2 on: November 10, 2009, 08:43:40 AM »
Quick Fix

mysql_real_escape_string($_POST['pic'])

Long fix is a bit more in depth :p

That' far from a fix xD
Logged

Diesel

  • Basic Member
  • *
  • Reputation Power: 6
  • Diesel has no influence.
  • Offline Offline
  • Posts: 14
    • View Profile
Re: Secure Display Picture Uploading
« Reply #3 on: November 10, 2009, 02:57:29 PM »


That' far from a fix xD
[/quote]

Do you think you could post a more suitable fix then?
Logged

JoshuaDams

  • Active Member
  • **
  • Reputation Power: 129
  • JoshuaDams is working their way up.JoshuaDams is working their way up.JoshuaDams is working their way up.
  • Offline Offline
  • Posts: 240
    • MSN Messenger - immortalthug4ever@hotmail.com
    • View Profile
    • WWW
Re: Secure Display Picture Uploading
« Reply #4 on: November 10, 2009, 02:59:24 PM »
He said quick fix :p

just makes sure they don't enter certain chars in the box >,<

I use something a bit more...lengthy :P

05timbyd

  • Basic Member
  • *
  • Reputation Power: 2
  • 05timbyd has no influence.
  • Offline Offline
  • Posts: 6
    • View Profile
    • Email
Re: Secure Display Picture Uploading
« Reply #5 on: March 07, 2010, 02:35:24 PM »
You need about 10-15 line to fix it :/ ("At Least")
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Secure Display Picture Uploading
« Reply #6 on: March 08, 2010, 09:44:21 AM »
Code: [Select]
<?php
$imgsize 
= @getimagesize($_POST['imgsrc']);//Change the post to the input one for prefs
if($imgsize === FALSE) {
echo
'Please use a real image, and stop attemping to hack.';
event_add(1$ir['username'].' attempted to add a file of some sort as their display pircture.');
}
exit;
}
Add this to prefs (submitted pic change)
Logged
Project Choosen - 10%
Daniel - Hanson . Com

CrimGame.com

  • Basic Member
  • *
  • Reputation Power: 21
  • CrimGame.com has no influence.
  • Offline Offline
  • Posts: 42
  • Play with me baby!
    • View Profile
    • WWW
Re: Secure Display Picture Uploading
« Reply #7 on: March 09, 2010, 09:37:20 AM »
Code: [Select]
<?php
     $imgsize 
= @getimagesize($_POST['imgsrc']);//Change the post to the input one for prefs
 
if( !is_array($imgsize) ) {
// error echo and so forth
 
} elseif ( is_array($imgsize) ) {
// update MySQL and so forth
 
}
     
$h->endpage();
     die;
?>

 


This forum is now closed and has moved to a new location! Click here to find out why.