tungwaiyip.info

home

about me

links

Blog

< May 2012 >
SuMoTuWeThFrSa
   1 2 3 4 5
6 7 8 9101112
13141516171819
20212223242526
2728293031  

past articles »

Click for San Francisco, California Forecast

San Francisco, USA

 

&D\anger'"+<b>@?!mb Against Code Injection

I have to build my web app against code injection. I find that the problem requires us to see input string used in several different context.

  • In HTML/XML as text.
  • In HTML/XML as an attribute inside the quote.
  • In URL as query parameter.
  • In JavaScript to dynamically create or edit DOM elements.

In each context, there are different rule in escaping them. Since the data can move from one context to another, they have to be properly escaped in all cases.

To help test for proper escaping, I have come up with a string that has lots of special characters below. Put it in your test database and paste it in your input fields. Observe if this causes problem anywhere. In properly escaped system, the string should be transfered and reconstructed verbatim.

  &D\anger'"+<b>@?!mb

A related issue is whether your code support unicode correctly. I find it helpful to insert a string below into the test data to test it out right from the beginning.

  \u4e09\u570b\u5fd7 or
  三國志

2012.05.01 [] - comments

 

 

blog comments powered by Disqus

past articles »

 

BBC News

 

Trump and Putin held another, undisclosed meeting at G20 (19 Jul 2017)

 

Justine Damond: Australian PM calls shooting 'inexplicable' (19 Jul 2017)

 

Let Obamacare fail - Trump's new plan (18 Jul 2017)

 

First child to undergo double hand transplant can now do this (18 Jul 2017)

 

Despacito breaks global streaming record (19 Jul 2017)

 

Doris Payne, 86-year-old jewel thief, arrested again (19 Jul 2017)

 

How did dogs become our best friends? New evidence (18 Jul 2017)

 

Briton and Italian die in beach rescue near Brindisi (18 Jul 2017)

 

Is WhatsApp being censored in China? (19 Jul 2017)

 

Antonio Conte: Chelsea manager signs improved two-year deal at champions (18 Jul 2017)

more »

 

SF Gate

 

Bay Area News (7 Jan 2012)

 

City Insider (11 Feb 2012)

 

Crime Scene (13 Feb 2012)

 

C.W Newius Column (10 Jan 2012)

 

C.W. Nevius Blog (11 Feb 2012)

 

Education News (10 Jan 2012)

 

KALW (11 Feb 2012)

 

Matier and Ross Blog (11 Feb 2012)

 

Cap-and-trade survives razor-thin votes in California Legislature (18 Jul 2017)

 

Ann Coulter battles Delta; Gillette goofs; Titleist sues (17 Jul 2017)

 

Business News Roundup, July 18 (17 Jul 2017)

 

Kitchen gadget maker Juicero feels squeeze, cuts 25% of staff (17 Jul 2017)

 

Judge limits Google pay, job data in Labor Department audit (17 Jul 2017)

 

Penguin pulls book by Doerr, tech CEO amid Duggan harassment suit (17 Jul 2017)

more »

 


Site feed Updated: 2017-Jul-19 00:00