473,378 Members | 1,404 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,378 software developers and data experts.

Ajax's Risks

Yahoo Mail Worm May Be First Of Many As Ajax Proliferates
<URL: http://www.ddj.com/189500417?cid=RSSfeed_DDJ_All>

Jun 21 '06 #1
5 1758
McKirahan wrote:
Yahoo Mail Worm May Be First Of Many As Ajax Proliferates
<URL: http://www.ddj.com/189500417?cid=RSSfeed_DDJ_All>


This is fairly old news, and if you read the article, it doesn't show a
risk in the use of Ajax - rather, it shows the risk of not cleaning up
<script> tags in user input.

It also shows Yahoo not thinking ahead.

But nothing really to do with Ajax.

--
"The most convoluted explanation that fits all the available and made-up
facts is the most likely to be believed by conspiracy theorists"
Jun 21 '06 #2
Tony wrote:
McKirahan wrote:
Yahoo Mail Worm May Be First Of Many As Ajax Proliferates
<URL: http://www.ddj.com/189500417?cid=RSSfeed_DDJ_All>

This is fairly old news, and if you read the article, it doesn't show a
risk in the use of Ajax - rather, it shows the risk of not cleaning up
<script> tags in user input.

It also shows Yahoo not thinking ahead.

But nothing really to do with Ajax.

Hi Tony,

you said
"it shows the risk of not cleaning up
<script> tags in user input."


Can you please suggest me how to do this so I'll do this to my scripts
in web apps.

Thanks
Kiran
Jun 28 '06 #3
Kiran wrote:
Tony wrote:
McKirahan wrote:
Yahoo Mail Worm May Be First Of Many As Ajax Proliferates
<URL: http://www.ddj.com/189500417?cid=RSSfeed_DDJ_All>


This is fairly old news, and if you read the article, it doesn't show
a risk in the use of Ajax - rather, it shows the risk of not cleaning
up <script> tags in user input.

It also shows Yahoo not thinking ahead.

But nothing really to do with Ajax.

Hi Tony,

you said
>"it shows the risk of not cleaning up
> <script> tags in user input."


Can you please suggest me how to do this so I'll do this to my scripts
in web apps.


I can't even begin to suggest it, not knowing what server-side language
you are using. You would be best off asking in the appropriate newsgroup
for that language.

But generally, it's the same as any other server-side cleaning of user
input. You are, for example, escaping quotes and other special
characters before anything goes into a database, right?

Just use a regular expression to search for <script...>...</script> -
once found, you have the option to (a) replace the < and > with &lt; and
&gt; (not always safe), (b) remove the script tage and leave the rest in
place, or (c) remove the script tags and everything between.

--
"The most convoluted explanation that fits all of the made-up facts is
the most likely to be believed by conspiracy theorists. Fitting the
actual facts is optional."
Jun 28 '06 #4

"Tony" <to****@dslextreme.WHATISTHIS.com> wrote in message
news:12*************@corp.supernews.com...
Kiran wrote:
Tony wrote:
McKirahan wrote:

Yahoo Mail Worm May Be First Of Many As Ajax Proliferates
<URL: http://www.ddj.com/189500417?cid=RSSfeed_DDJ_All>

This is fairly old news, and if you read the article, it doesn't show
a risk in the use of Ajax - rather, it shows the risk of not cleaning
up <script> tags in user input.

It also shows Yahoo not thinking ahead.

But nothing really to do with Ajax.

Hi Tony,

you said
>"it shows the risk of not cleaning up
> <script> tags in user input."


Can you please suggest me how to do this so I'll do this to my scripts
in web apps.


I can't even begin to suggest it, not knowing what server-side language
you are using. You would be best off asking in the appropriate newsgroup
for that language.

But generally, it's the same as any other server-side cleaning of user
input. You are, for example, escaping quotes and other special
characters before anything goes into a database, right?

Just use a regular expression to search for <script...>...</script> -
once found, you have the option to (a) replace the < and > with &lt; and
&gt; (not always safe), (b) remove the script tage and leave the rest in
place, or (c) remove the script tags and everything between.

--
"The most convoluted explanation that fits all of the made-up facts is
the most likely to be believed by conspiracy theorists. Fitting the
actual facts is optional."


I find the best way is to use an XML DOM on the server to build the response
even if the reponse is intended to be a fragment of HTML. Any user entered
text or text from a DB will intrinsically be escaped when added to the DOM.

Of course this doesn't nullify the need to validate incoming inputs to
protect from and detect attempted attacks.

Anthony.
Jun 29 '06 #5
Just htmlencode and then the script becomes harmless. java and .net both
have methods to enable you to do this. .net will by default not allow this
content through because of validation being tunred on by default. You'll get
an exception - which is not what you want but at least it is safe. Just
ensure if you switch validation off that you htmlencode user input destined
back for the response stream.

"Anthony Jones" <An*@yadayadayada.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>
"Tony" <to****@dslextreme.WHATISTHIS.comwrote in message
news:12*************@corp.supernews.com...
>Kiran wrote:
Tony wrote:

McKirahan wrote:

Yahoo Mail Worm May Be First Of Many As Ajax Proliferates
<URL: http://www.ddj.com/189500417?cid=RSSfeed_DDJ_All>

This is fairly old news, and if you read the article, it doesn't show
a risk in the use of Ajax - rather, it shows the risk of not cleaning
up <scripttags in user input.

It also shows Yahoo not thinking ahead.

But nothing really to do with Ajax.

Hi Tony,

you said

>"it shows the risk of not cleaning up
<scripttags in user input."

Can you please suggest me how to do this so I'll do this to my scripts
in web apps.

I can't even begin to suggest it, not knowing what server-side language
you are using. You would be best off asking in the appropriate newsgroup
for that language.

But generally, it's the same as any other server-side cleaning of user
input. You are, for example, escaping quotes and other special
characters before anything goes into a database, right?

Just use a regular expression to search for <script...>...</script-
once found, you have the option to (a) replace the < and with &lt; and
&gt; (not always safe), (b) remove the script tage and leave the rest in
place, or (c) remove the script tags and everything between.

--
"The most convoluted explanation that fits all of the made-up facts is
the most likely to be believed by conspiracy theorists. Fitting the
actual facts is optional."

I find the best way is to use an XML DOM on the server to build the
response
even if the reponse is intended to be a fragment of HTML. Any user
entered
text or text from a DB will intrinsically be escaped when added to the
DOM.

Of course this doesn't nullify the need to validate incoming inputs to
protect from and detect attempted attacks.

Anthony.


Jul 20 '06 #6

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

Similar topics

9
by: studyandjobs | last post by:
Computer Industry Workers May Face Cancer Risks http://www.studyandjobs.com/Comp_worker_cancer.html or visit http://www.studyandjobs.com/Cancer.html Regards ..
4
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
9
by: nachbar.unimatch | last post by:
Are you a young programmer with some experience in javascript, XML, HTML living in London? Are you interested in a idea for an internet start-up? Then respond to the email adress above. No spam. ...
2
by: jmoran | last post by:
Hello there. I've been thinking if some AJAX-authentication system is secure since Javascript is downloaded into the client machine... Thanks in advance for your help.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.