473,388 Members | 1,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Lemos form class

In reference to the Manual Lemos Form class, does anybody know if the
class does anything to prevent SQL injection attacks or provide any
kind of security by cleaning _POST variables?

Also, does anybody know of functions or classes that clean variables to
prevent SQL injection attacks or other security issues?

Thanks

Jul 17 '05 #1
4 2625
In article <11**********************@c13g2000cwb.googlegroups .com>,
"diroddi" <ja***@diroddi.com> wrote:
In reference to the Manual Lemos Form class, does anybody know if the
class does anything to prevent SQL injection attacks or provide any
kind of security by cleaning _POST variables?

Also, does anybody know of functions or classes that clean variables to
prevent SQL injection attacks or other security issues?

Thanks


Well, you have the code. Why not read it and figure that out for
yourself? Such exploits allow unvalidated data to be entered into
fields on a web form and inserted directly into a MySQL database. To
prevent that, you strip various things out like all HTML and Javascript.
You also "escape" various things like single and double quotes.

Does his code do this? What would you need to modify to add this
enhancment?

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 17 '05 #2
Hello,

on 01/04/2005 11:40 PM diroddi said the following:
In reference to the Manual Lemos Form class, does anybody know if the
class does anything to prevent SQL injection attacks or provide any
kind of security by cleaning _POST variables?

Also, does anybody know of functions or classes that clean variables to
prevent SQL injection attacks or other security issues?


Yes, if you use the DiscardInvalidValues option you can tell the class
to discard values that are not considered valid.

For instance, if you are editing a database record and you need to pass
the record id which is usually an integer value, if an hacker tries to
spoof that value passing something like "0 ; DROP TABLE users;" and you
used ValidateAsInteger and DiscardInvalidValues, the class will ignore
the submitted value and restore the default value.

Anyway, SQL injection prevention should be mostly done at SQL execution
time. If you are deailing with text values, you should quote them
properly to escape any characters that have special meaning for your
database server.

Personally, I use Metabase as database abstraction package and so I am
always safe from SQL injection exploits as it comes with functions like
GetTextFieldValue() that do the appropriate quoting of text field values
when the query statments are composed. You can also use Metabase
prepared queries support that perform the necessary conversion or
quoting of data values where needed.

http://www.phpclasses.org/metabase
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #3
Manuel Lemos wrote:
Personally, I use Metabase as database abstraction package and so I am
always safe from SQL injection exploits as it comes with functions like
GetTextFieldValue() that do the appropriate quoting of text field values
when the query statments are composed. You can also use Metabase
prepared queries support that perform the necessary conversion or
quoting of data values where needed.

http://www.phpclasses.org/metabase


I had used Metabase for a while as well and found it to be quite easy to
use. I have recently (in the last year or so) switched over to PEAR::MDB
simply because it is part of PEAR and I don't have to copy its code to
each site I host. Since that is so close to Metabase as far as API is
concerned, there was very little learning curve or porting effort. All
in all, both projects are well planned and are only missing a few
features that I could have used at one point. (I have yet to search in
MDB for previous missing features...)

--
Justin Koivisto - ju****@koivi.com
http://www.koivi.com
Jul 17 '05 #4
Hello,

on 01/05/2005 01:52 PM Justin Koivisto said the following:
Personally, I use Metabase as database abstraction package and so I am
always safe from SQL injection exploits as it comes with functions
like GetTextFieldValue() that do the appropriate quoting of text field
values when the query statments are composed. You can also use
Metabase prepared queries support that perform the necessary
conversion or quoting of data values where needed.

http://www.phpclasses.org/metabase


I had used Metabase for a while as well and found it to be quite easy to
use. I have recently (in the last year or so) switched over to PEAR::MDB
simply because it is part of PEAR and I don't have to copy its code to
each site I host. Since that is so close to Metabase as far as API is
concerned, there was very little learning curve or porting effort. All
in all, both projects are well planned and are only missing a few
features that I could have used at one point. (I have yet to search in
MDB for previous missing features...)


That is because MDB is just a PEARified version of Metabase! ;-)

MDB was meant to be a transition from PEAR::DB to Metabase as it provide
a compatible API, so PEAR::DB users can benefit from true database
independence provided by Metabase without having change their database
calls too much.

If you were using Metabase you probably did not gain anything except
some work in changing your database calls in your applications. From
what I could understand from Lukas work MDB is being deprecated in
favour MDB2 which breaks compatibility with MDB.
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dr zoidberg | last post by:
Hello, I'm creating registration service with this great form script for creating forms within Smarty. Question is how can I validate 'username' against allready registered users in MySQL? ...
1
by: diroddi | last post by:
How do you validate a SELECT field with m. lemos forms validation class. I want to make sure the user has selected a product and not left the field as the default of 'Select One'. ...
4
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
2
by: Citoyen du Monde | last post by:
Trying to get some ideas on a simple javascript project (to teach myself the language). I want to develop a client-side vocabulary practice application that would allow users to enter their own...
13
by: genetic.error | last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up before... The VS.Net MSDN file seems to state that the following should work: Form1.Show Form1.Visible = True Form1.Hide...
3
by: John A. Prejean | last post by:
This one has me stumped. I have a base form I am trying to wrap up, but I have one problem. In two functions I am opening a "record detail" form. I would like to keep the code in the base form...
19
by: hamil | last post by:
I have a form with one button, Button1, and a Textbox, Textbox1 I have a class, class1 as follows. Public Class Class1 Public DeForm As Object Sub doit() DeForm.Textbox1.text = "It works"...
5
by: timothy.pollard | last post by:
Hi I'm having a bit of bother trying to make a questionnaire do what I want it to. I have put it up on www.web-iq.co.uk/test.htm. Basically the user of the final form (when I've tarted it up)...
6
by: Thom Little | last post by:
Using C# 3.5 I have a form that calls many other sub-forms. Typically there will be five forms open at the same time. If the main form is closed all the sub forms are also closed. Is there...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.