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

 

Ex-FTX boss Bankman-Fried: 'I didn't try to commit fraud' (01 Dec 2022)

 

Cyril Ramaphosa: South African president faces threat of impeachment over 'Farmgate' (01 Dec 2022)

 

Christine McVie, Fleetwood Mac singer-songwriter, dies aged 79 (01 Dec 2022)

 

Lady Susan Hussey quits over remarks to charity boss Ngozi Fulani (30 Nov 2022)

 

Spectacular scenes as Hawaii volcano erupts (30 Nov 2022)

 

Danny Masterson: Jury fails to reach a verdict in rape case against That 70s Show actor (01 Dec 2022)

 

Canada: Ambassador tells EU that deforestation rules 'burdensome' (01 Dec 2022)

 

Idaho stabbings: Families deliver tributes for the four victims at vigil (01 Dec 2022)

 

San Francisco to allow police 'killer robots' (30 Nov 2022)

 

Musk says Twitter feud with Apple boss 'resolved' (01 Dec 2022)

more »

 

SF Gate

 

San Francisco food delivery giant DoorDash lays off 1,250 employees (30 Nov 2022)

 

20-year-old California student creates viral Spotify festival poster app (29 Nov 2022)

 

Elon Musk’s Twitter cuts COVID misinformation policy, guts child safety protections (29 Nov 2022)

 

Elon Musk’s Twitter is reportedly failing to pay some employees (28 Nov 2022)

 

Bay Area tech mainstay HP to lay off up to 6,000 people (26 Nov 2022)

 

Elon Musk signals his support for Ron DeSantis in 2024 on Twitter (25 Nov 2022)

more »


Site feed Updated: 2022-Nov-30 21:00