You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Nanduri, Amarnath" <Am...@Agilquest.com> on 2001/05/11 14:35:22 UTC

filtering unwanted characters

Hi all,

     I might be posting this message in the wrong forum. My apologies if i
have offended anyone.

    I am looking for some open source code that deals with filtering
technology. Basically i want to filter any unwanted characters from the user
input data. The user might try to pass in some SQL quesries or try to run
some shell scripts or put special characters which might be rejected by a
database (or even corrupt it). If no such open source code is available then
i want to write something like that. I was wondering if anyone has done some
thing like this in the past and if so, can they share their experiences ?
Also is there any place i can search for some 'searching algorithms' which i
plan to use as the backbone of my filters that i plan to implement. Thank
you very much.....

p.s We are using struts bigtime to develop a huge internationalized project.
So far it didn't let us down.

cheers,
Amar..

Re: filtering unwanted characters

Posted by Jonathan <ja...@i-2000.com>.
try a sax parser

----- Original Message -----
From: "Nanduri, Amarnath" <Am...@Agilquest.com>
To: <st...@jakarta.apache.org>
Sent: Friday, May 11, 2001 8:35 AM
Subject: filtering unwanted characters


>
> Hi all,
>
>      I might be posting this message in the wrong forum. My apologies if i
> have offended anyone.
>
>     I am looking for some open source code that deals with filtering
> technology. Basically i want to filter any unwanted characters from the
user
> input data. The user might try to pass in some SQL quesries or try to run
> some shell scripts or put special characters which might be rejected by a
> database (or even corrupt it). If no such open source code is available
then
> i want to write something like that. I was wondering if anyone has done
some
> thing like this in the past and if so, can they share their experiences ?
> Also is there any place i can search for some 'searching algorithms' which
i
> plan to use as the backbone of my filters that i plan to implement. Thank
> you very much.....
>
> p.s We are using struts bigtime to develop a huge internationalized
project.
> So far it didn't let us down.
>
> cheers,
> Amar..
>


nanduri can u help ??ApplicationResources.properties

Posted by Amit Jain <am...@imoney.co.uk>.
My weblogic is complaining of ApplicationResources.properties file not
found..
I copied it to the _tmp_war** directory manually and when i restart it
creates a new _tmp_war** directory..so can't help

any solutions please.

-----Original Message-----
From: Nanduri, Amarnath [mailto:Amarnath.Nanduri@Agilquest.com]
Sent: Friday, May 11, 2001 1:35 PM
To: 'struts-user@jakarta.apache.org'
Subject: filtering unwanted characters



Hi all,

     I might be posting this message in the wrong forum. My apologies if i
have offended anyone.

    I am looking for some open source code that deals with filtering
technology. Basically i want to filter any unwanted characters from the user
input data. The user might try to pass in some SQL quesries or try to run
some shell scripts or put special characters which might be rejected by a
database (or even corrupt it). If no such open source code is available then
i want to write something like that. I was wondering if anyone has done some
thing like this in the past and if so, can they share their experiences ?
Also is there any place i can search for some 'searching algorithms' which i
plan to use as the backbone of my filters that i plan to implement. Thank
you very much.....

p.s We are using struts bigtime to develop a huge internationalized project.
So far it didn't let us down.

cheers,
Amar..


Legal Disclaimer:-

Please be aware that messages sent over the Internet may not 
be secure and should not be seen as forming a legally binding
contract unless otherwise stated.


Re: filtering unwanted characters

Posted by Jonathan Asbell <ja...@i-2000.com>.
See the character filter I donated last week

----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: <st...@jakarta.apache.org>
Sent: Friday, June 01, 2001 9:31 PM
Subject: Re: filtering unwanted characters


>
>
> On Fri, 11 May 2001, Ian Kallen <ia...@covalent.net> wrote:
>
> >
> > Apache 2.0 supports input filters, how about writing one that cleans the
> > data input before mod_jk/mod_webapp can hand it off to Tomcat?
> >
>
> In a Servlet 2.3 environment (such as Tomcat 4.0), you can use the new
> Filter APIs to accomplish the same thing.
>
> However, either of these approaches means you have to parse out the
> request parameters and put them back together again for the
> "real" servlet.  That sounds like a lot more work than should be needed.
>
> > On Fri, 11 May 2001, Nanduri, Amarnath wrote: > I am looking for some
> > open source code that deals with filtering > technology. Basically i
> > want to filter any unwanted characters from the user > input data. The
> > user might try to pass in some SQL quesries or try to run > some shell
> > scripts or put special characters which might be rejected by a >
> > database (or even corrupt it). If no such open source code is
> > available then > i want to write something like that. I was wondering
> > if anyone has done some
> >
>
> Have you considered putting stuff like this in the validate() method of
> your form bean?  You could probably write a common utility method that
> scanned a String for unwanted characters, returning "true" if there was a
> problem.  Then, your validate() method would pass all the input strings in
> the form through this method to look for problems.
>
> The other thing that really really helps when doing database stuff is to
> use JDBC PreparedStatement objects.  That way, even if your users try to
> pass in wierd command delimiters and stuff, it ends up inside an SQL
> string that is properly quoted by the driver itself, rather than modifying
> the SQL command you are trying to run.
>
> > cheers,
> > -Ian
> >
> > --
> > Ian Kallen <ia...@covalent.net> | AIM: iankallen
> >
> >
>
> Craig
>
>


Re: filtering unwanted characters

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 11 May 2001, Ian Kallen <ia...@covalent.net> wrote:

> 
> Apache 2.0 supports input filters, how about writing one that cleans the
> data input before mod_jk/mod_webapp can hand it off to Tomcat?
> 

In a Servlet 2.3 environment (such as Tomcat 4.0), you can use the new
Filter APIs to accomplish the same thing.

However, either of these approaches means you have to parse out the
request parameters and put them back together again for the
"real" servlet.  That sounds like a lot more work than should be needed.

> On Fri, 11 May 2001, Nanduri, Amarnath wrote: > I am looking for some
> open source code that deals with filtering > technology. Basically i
> want to filter any unwanted characters from the user > input data. The
> user might try to pass in some SQL quesries or try to run > some shell
> scripts or put special characters which might be rejected by a >
> database (or even corrupt it). If no such open source code is
> available then > i want to write something like that. I was wondering
> if anyone has done some
> 

Have you considered putting stuff like this in the validate() method of
your form bean?  You could probably write a common utility method that
scanned a String for unwanted characters, returning "true" if there was a
problem.  Then, your validate() method would pass all the input strings in
the form through this method to look for problems.

The other thing that really really helps when doing database stuff is to
use JDBC PreparedStatement objects.  That way, even if your users try to
pass in wierd command delimiters and stuff, it ends up inside an SQL
string that is properly quoted by the driver itself, rather than modifying
the SQL command you are trying to run.

> cheers,
> -Ian
> 
> --
> Ian Kallen <ia...@covalent.net> | AIM: iankallen
> 
> 

Craig



Re: filtering unwanted characters

Posted by "Ian Kallen <iank@covalent.net>" <ia...@covalent.net>.
Apache 2.0 supports input filters, how about writing one that cleans the
data input before mod_jk/mod_webapp can hand it off to Tomcat?

On Fri, 11 May 2001, Nanduri, Amarnath wrote:
>     I am looking for some open source code that deals with filtering
> technology. Basically i want to filter any unwanted characters from the user
> input data. The user might try to pass in some SQL quesries or try to run
> some shell scripts or put special characters which might be rejected by a
> database (or even corrupt it). If no such open source code is available then
> i want to write something like that. I was wondering if anyone has done some

cheers,
-Ian

--
Ian Kallen <ia...@covalent.net> | AIM: iankallen