Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Do you whitelist or blacklist utf-8?
- Date: Thu, 24 Feb 2011 10:14:04 +0900 (JST)
- From: "Nikolay Elenkov" <nick@example.com>
- Subject: Re: [tlug] Do you whitelist or blacklist utf-8?
- References: <4D639689.1010302@example.com> <4D63EFBC.1020900@example.com> <4D64C5DD.1040607@example.com> <4D64CB49.10906@example.com> <4D652AF5.10304@example.com> <4D655712.1090608@example.com>
- User-agent: SquirrelMail/1.4.8-2.el4.centos4
2011年 2月 24日(木)3:50 am に Shmuel Fomberg さんは書きました: >>> but first you need to tell us something about your data. is the user >>> allowed to enter HTML tags? >> Nope. I want to be real strict. They get: >> No punctuation at all. >> Only spaces, no other white space (tabs, line feed characters, or >> anything else). >> They can have 0-9a-zA-Z, and anything above the ASCII range (taking into >> account what you wrote above). > Then you are pretty safe from XSS. > All these attacks are basically injecting unwanted html tags to your site. > if you don't allow any pun, then no tags can be injected. > Filtering input is one thing, but if you really want to avoid XSS, you need to HTML escape anything that could've come from outside when *displaying* it. Most modern environment do that for you by default (or there is an 'htmlEscape' switch you can flip), but check just in case. BTW, unnecessary filtering/restrictions and replacing of characters can be *really* annoying. I curse every time I have to fill a form that tells me to enter my name in full-width *kanji*, then my phone number in half-width romaji, then my address in..., etc. The more obnoxious ones limit the length of the name field to 8 chars, or so... Even more annoying when you try to format something, and you find out they stripped all of your spaces. Just something to consider when trying to make you input checks air-tight. And, yeah, for better security, don't use PHP :)
- Follow-Ups:
- Re: [tlug] Do you whitelist or blacklist utf-8?
- From: Darren Cook
- References:
- [tlug] Do you whitelist or blacklist utf-8?
- From: Dave M G
- Re: [tlug] Do you whitelist or blacklist utf-8?
- From: Shmuel Fomberg
- Re: [tlug] Do you whitelist or blacklist utf-8?
- From: Dave M G
- Re: [tlug] Do you whitelist or blacklist utf-8?
- From: Shmuel Fomberg
- Re: [tlug] Do you whitelist or blacklist utf-8?
- From: Dave M G
- Re: [tlug] Do you whitelist or blacklist utf-8?
- From: Shmuel Fomberg
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Do you whitelist or blacklist utf-8?
- Next by Date: Re: [tlug] cacert question
- Previous by thread: Re: [tlug] Do you whitelist or blacklist utf-8?
- Next by thread: Re: [tlug] Do you whitelist or blacklist utf-8?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links