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

 

Syria: Turkey war planes launch strikes on Afrin (20 Jan 2018)

 

Kabul: Gunmen attack Intercontinental Hotel (20 Jan 2018)

 

US shutdown: Trump and Democrats blame each other (20 Jan 2018)

 

Women's marches draw crowds in US (20 Jan 2018)

 

Paul Bocuse: Top French chef dies at 91 (20 Jan 2018)

 

Ed Sheeran announces engagement (20 Jan 2018)

 

Brazil declares yellow fever emergency in Minas Gerais (21 Jan 2018)

 

Winter Olympics 2018: North Korea will send 22 athletes to Pyeongchang (20 Jan 2018)

 

Clashes continue over disputed Honduras election result (21 Jan 2018)

 

Deported from Belgium, tortured in Sudan (21 Jan 2018)

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)

 

Virtual assistants still baffle some of their users (20 Jan 2018)

 

China’s economic growth looks strong — maybe too strong (20 Jan 2018)

 

Twitter analyst support piles up as turnaround gains steam (20 Jan 2018)

 

Antismoking plan may kill cigarettes, and save Big Tobacco (20 Jan 2018)

 

Facebook to start ranking news sources on trustworthiness (20 Jan 2018)

 

Amazon’s bigger Prime number; ‘Game of Thrones’ hotel; Delta pet crackdown (19 Jan 2018)

more »

 


Site feed Updated: 2018-Jan-20 18:00