Zero Identity Forums - General - Web Security - clean the input.
Are you bored? Check out the unaswered threads!
|
swiftnomad
![]() Administrator Public Relations ZI Guru Joined: 04.04.2008 Last Seen: 10 year(s) ago Experience: 3274.18 Points: 405 |
|
| #1 clean the input. on April 24 2009 00:57 | |
|
Ok, i am moving an application to div tags and working hard on that, can you guys look at the code and sanitize this for me? I just have so much on my plate and I need to finish this; this weekend.
I'll send some money to your paypal if you can do it for me. Please use: Code Highlighting :: Select Code Thanks, i'm still changing a lot of the html and really didn't get into any of the php coding, i know it needs to be done.. i will update my latest version soon, then you guys can check it. ![]() USER: Hello Tech Support? I can't print... ME: Try cursive then <hang up> |
|
|
Grindordie
![]() Administrator Software Engineer ![]() ZI Guru Joined: 04.11.2007 Last Seen: 10 year(s) ago Experience: 1074.3 Points: 1100 |
|
| #2 Software Engineer on April 24 2009 01:48 | |
|
In the config.php file use a function that cleans $_POST, $_GET, $_REQUEST
Code Highlighting :: Select Code Replace $myArr with $_GET, $_POST, $_REQUEST and you're done. ![]() Obviously, it's the easy way [without altering every page] but, if you're looking to protect against SQL Injections - that's your solution. It will not protect you from XSS or any other types of attack |
|
|
swiftnomad
![]() Administrator Public Relations ZI Guru Joined: 04.04.2008 Last Seen: 10 year(s) ago Experience: 3274.18 Points: 405 |
|
| #3 on April 24 2009 13:04 | |
|
you fucking whore grind. i swear to fucking god. :P i love you! I didn't even fucking think of that, i'm going to make a switch statement for the paging, and im going to use a library for xss shit..
USER: Hello Tech Support? I can't print... ME: Try cursive then <hang up> |
|
|
Grindordie
![]() Administrator Software Engineer ![]() ZI Guru Joined: 04.11.2007 Last Seen: 10 year(s) ago Experience: 1074.3 Points: 1100 |
|
| #4 on April 24 2009 19:14 | |
|
Now, please send $1M to my cousin in Nigeria; in 6 months, he will reimburse you with $3M (300% of original investment!!!)
You can do it for XSS too.. but the down-side will be that if you want to see the original value, you will need to convert it back to html entities html_entity_decode() and strip the slashes. I'm serious, my cousin in Nigeria is legit. |
|
|
swiftnomad
![]() Administrator Public Relations ZI Guru Joined: 04.04.2008 Last Seen: 10 year(s) ago Experience: 3274.18 Points: 405 |
|
| #5 on April 25 2009 12:54 | |
|
so, I did something like this:
Code Highlighting :: Select Code here I added this: Code Highlighting :: Select Code and here i am cleaning it. Code Highlighting :: Select Code right? USER: Hello Tech Support? I can't print... ME: Try cursive then <hang up> |
|
|
Grindordie
![]() Administrator Software Engineer ![]() ZI Guru Joined: 04.11.2007 Last Seen: 10 year(s) ago Experience: 1074.3 Points: 1100 |
|
| #6 Software Engineer on April 25 2009 15:34 | |
|
Code Highlighting :: Select Code Ewwww wtf? Why would you strip tags then htmlspecialchars() it & not touch the quotes... Code Highlighting :: Select Code "ENT_QUOTES Will convert both double and single quotes" "htmlentities � Convert all applicable characters to HTML entities" "mysql_escape_string � Escapes a string for use in a mysql_query" That's all you need to protect your input. You already parse it before entering into the database, so you don't have to do it later. Beware that if someone gets hold of your db, they can just enter XSS in there and it will be shown on the site (since we're cleansing it before - there is no need to double escape it) Why are you using cleanInput() only when someone logs in? Wouldn't it be easier to just add clean_text() to those 3 variables? |
|
Who is watching forums
| Users viewing this page: | Guests (1) |
| Users viewing the forum: | 1 |










