473,408 Members | 2,839 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,408 software developers and data experts.

Is there a easier way to avoid harmful html code?

When I create a web site, there are some places that allow user to input
html code, like in content of a message. But for security purpose, you can
not allow user use all html features, like javascript. I found some sites
are using UBB code and claim it is safer. I am wonderring if .NET provides
some easier way for this? I feel that .NET does have a feature to avoid user
type in html code, but is there a feature that allows some safe html code
but not others?

Thanks!
Nov 22 '05 #1
4 1423
You could provide your own markup code, or inspect the code to make sure
it's only have your own approved tags. Get a Regex to find all tags, and
then if one of them doesn't match your list of few tags, then reject the
message.

"Safe HTML" depends on the site and what you deem to be bad. Obviously
SCRIPT is not good, but having people put arbitrary styles and overwrite
your page (and get people to click on fake links that appear to be part of
your page) can be just as damaging.

-mike
MVP

"david" <wy*****@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
When I create a web site, there are some places that allow user to input
html code, like in content of a message. But for security purpose, you can
not allow user use all html features, like javascript. I found some sites
are using UBB code and claim it is safer. I am wonderring if .NET provides
some easier way for this? I feel that .NET does have a feature to avoid user type in html code, but is there a feature that allows some safe html code
but not others?

Thanks!

Nov 22 '05 #2
You could provide your own markup code, or inspect the code to make sure
it's only have your own approved tags. Get a Regex to find all tags, and
then if one of them doesn't match your list of few tags, then reject the
message.

"Safe HTML" depends on the site and what you deem to be bad. Obviously
SCRIPT is not good, but having people put arbitrary styles and overwrite
your page (and get people to click on fake links that appear to be part of
your page) can be just as damaging.

-mike
MVP

"david" <wy*****@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
When I create a web site, there are some places that allow user to input
html code, like in content of a message. But for security purpose, you can
not allow user use all html features, like javascript. I found some sites
are using UBB code and claim it is safer. I am wonderring if .NET provides
some easier way for this? I feel that .NET does have a feature to avoid user type in html code, but is there a feature that allows some safe html code
but not others?

Thanks!

Nov 22 '05 #3
Thanks! that helps.

"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
You could provide your own markup code, or inspect the code to make sure
it's only have your own approved tags. Get a Regex to find all tags, and
then if one of them doesn't match your list of few tags, then reject the
message.

"Safe HTML" depends on the site and what you deem to be bad. Obviously
SCRIPT is not good, but having people put arbitrary styles and overwrite
your page (and get people to click on fake links that appear to be part of
your page) can be just as damaging.

-mike
MVP

"david" <wy*****@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
When I create a web site, there are some places that allow user to input
html code, like in content of a message. But for security purpose, you can not allow user use all html features, like javascript. I found some sites are using UBB code and claim it is safer. I am wonderring if .NET provides some easier way for this? I feel that .NET does have a feature to avoid

user
type in html code, but is there a feature that allows some safe html code but not others?

Thanks!


Nov 22 '05 #4
Thanks! that helps.

"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
You could provide your own markup code, or inspect the code to make sure
it's only have your own approved tags. Get a Regex to find all tags, and
then if one of them doesn't match your list of few tags, then reject the
message.

"Safe HTML" depends on the site and what you deem to be bad. Obviously
SCRIPT is not good, but having people put arbitrary styles and overwrite
your page (and get people to click on fake links that appear to be part of
your page) can be just as damaging.

-mike
MVP

"david" <wy*****@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
When I create a web site, there are some places that allow user to input
html code, like in content of a message. But for security purpose, you can not allow user use all html features, like javascript. I found some sites are using UBB code and claim it is safer. I am wonderring if .NET provides some easier way for this? I feel that .NET does have a feature to avoid

user
type in html code, but is there a feature that allows some safe html code but not others?

Thanks!


Nov 22 '05 #5

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

Similar topics

17
by: Rob | last post by:
i know javascript, vbscript, asp css and alot more and im only 14 i was wondering which is easier to learn php or cgi. any help?
73
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
9
by: mike420 | last post by:
map(lambda f: f(1), ) Oh, OK, it was a typo (1 instead of i). I take it all back (for now). It was an honest mistake, not a troll! Still, I think it should be instead of
32
by: Andreas Prilop | last post by:
Here is an illustration of the warning http://ppewww.ph.gla.ac.uk/~flavell/charset/browsers-fonts.html#dont that you should not specify a typeface when you have characters outside West European...
2
by: Mario T. Lanza | last post by:
Greetings, I have been developing websites in CSS for a couple years; I claim to be no expert, but certain things could definitely be easier. Consider the box model and it's different...
2
by: david | last post by:
When I create a web site, there are some places that allow user to input html code, like in content of a message. But for security purpose, you can not allow user use all html features, like...
61
by: Steven T. Hatton | last post by:
Stroustrup's view on classes, for the most part, seems to be centered around the notion of invariants. After a bit of adjusting to the use of yamt (yet another math term) in computer science, I...
2
by: mvendertaca | last post by:
I've created a usercontrol which is hosted in Internet Explorer. It with some action buttons. I could place all buttons on this usercontrol but I did not. When the user presses one of the buttons i...
6
by: howa | last post by:
Since it is part fo the standard, why I always heard that we should avoid iframe? any comments? thanks.
11
by: EnjoyNews | last post by:
Hi I just had a thought regarding spam... I have noticed that when I do something in JavaAjax then I can't se the context in the source. .... If I open a page in a div with Ajax, right click...
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...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.