`
`David Scott
`Laboratory For Communications Engineering
`Engineering Department
`Trumpington Street
`Cambridge
`CB2 1PZ
`djs55@eng.cam.ac.uk
`
`Richard Sharp
`Computer Laboratory
`William Gates Building
`JJ Thompson Avenue
`Cambridge
`CB3 0FD
`rws26@cl.cam.ac.uk
`
`ABSTRACT
`A icai eve web ec iy efe v eabi iie ihe
`e i he c de f a web a icai ie f ieecive f he
`ech gie i which i i i e eed he ec iy f he
`web eve/back ed daabae which i i b i . he
` a few h a icai eve v eabi iie have bee
`ex ied wih ei c e ece: hacke have icked
`e c ece ie i hiig g d f chage e
`a e ad aw d have bee haveed ad c (cid:12)deia
`if ai ch a addee ad cedi cad be ha
`bee eaked.
` hi ae we iveigae ew ad echi e
`which adde he b e f a icai eve web ec
`iy. We i decibe a ca ab e c ig echai faci
`iaig he abaci f ec iy icie f age web
`a icai deve ed i hee ge i af evi
` e; ii ee a which ai ga e de
`ve ec e a icai which ae ei ie a wide age
` f c aack; ad iii e e ad exeiece
`aiig f i e eai f hee echi e.
`
`Categories and Subject Descriptors
`D.2.2 [S fwae Egieeig]: Deig T ad Tech
`i e| d e ad ieface; D.2.12 [S fwae Egi
`eeig]: e eabi iy|ieface de(cid:12)ii ag age
`
`General Terms
`Sec iy Deig
`
`Keywords
`A icai eve Web Sec iy Sec iy icy Decii
`ag age C e baed Deig
`
`1.
`
`INTRODUCTION
` he 25h a ay 2001 a aic e aeaed i a e
`eced Biih ewae ei ed Sec iy e Theae
`Biih E ai e [13]. The aic e decibed h w a j a i
`hacked a be f e c ece ie ccef y b yig
`g d f e ha hei ieded ice. The aack e
` ed i a be f chae beig ade f 10 ece
`each ic dig a iee d ai a e ivehady . g. k
`a \Wa e Diec" ca eda ad icke f a i y ai
`Copyright is held by the author/owner(s).
`WWW2002, May 7–11, 2002, Honolulu, Hawaii, USA.
`ACM 1-58113-449-5/02/0005.
`
`c ce1. The a h f he aic e igh y beve ha he
` ce \e ie aic a echica ki "; he aack
` ee y iv ve avig he T f dik difyig
`he ice ed i a hidde f (cid:12)e d ig a ex edi
`ad e adig he T f back i he b we. A
`ece aic e b ihed i ZD e [17] gge ha be
`wee 30 ad 40 f e c ece ie h gh he
`w d ae v eab e hi i e aack. ee Sec iy
`Sye SS idei(cid:12)ed e eve wide y de yed c ecia
`h ig ca a icai which (cid:11)e f he v eabi
`iy [14].
`The ice chagig aack i a c e ece f a a i
`cai eve ec iy h e. We e he e a icai
` eve web ec iy efe v eabi iie ihee i he
`c de f a web a icai ie f ieecive f he ech
` gy i which i i i e eed he ec iy f he
`web eve/back ed daabae which i i b i .
`a icai eve ec iy h e aie beca e web a ica
`i iake y daa e ed f a c ie. F
`exa e i he ice chagig aack he web a icai
` ake he iva id a i ha a e ca dify he
`ice beca e i i ed i a hidde (cid:12)e d.
`A icai eve ec iy v eabi iie ae we k w
`ad ay aic e have bee b ihed adviig deve
`e h w hey ca be av ided [22 23 28]. Fixig a i
`g e cc ece f a v eabi iy i a y eay. weve
`he aive be f ieaci bewee di(cid:11)ee c
` e f a dya ic webie ake a icai eve e
`c iy cha egig i geea . Deie e e(cid:11)
`ighe a icai eve ec iy h gh c de eview ad
` he fwae egieeig acice [18] he fac e ai
`ha a age be f fei a y deiged webie i
` (cid:11)e f ei a icai eve ec iy h e. Thi ev
`idece gge ha highe eve ad echi e ae
`e ied adde he b e .
` hi ae we ee a c ig echi e which
`he deige abac ec iy icie f age web a
` icai . ye c i f a ecia ied Sec iy
` icy Decii ag age SD which i ed
`ga a a icai eve (cid:12)ewa efeed a a ec
`iy gaeway. Sec iy icie ae wie i SD ad
`c i ed f exec i he ec iy gaeway. The ec
`iy gaeway dya ica y aa ye ad af TT
`e e/e e ef ce he eci(cid:12)ed icy.
`
`1S e eade ay ag e ha 10 i he e va e f icke
` ch a c ce. A f dic i f hi ic i ide
`he c e f hi ae.
`
`396
`
`
`
`The e aide f he ae i c ed a f w: Sec
`i 2 vey a be f a icai eve aack ad di
`c e e f he ea why a icai eve v eabi i
`ie ae eva e i acice. Seci 3 we decibe he
`echica deai f ye f abacig a icai
` eve web ec iy. eh d gy i i aed wih a
`exeded exa e i Seci 4 ad we dic h w he idea
`i hi ae ay be geea ied i Seci 5. We have i
` e eed he echi e dic ed i hi ae. The e
`f ace f i e eai i eva aed i Seci 6.
`Re aed w k i dic ed i Seci 7; (cid:12)a y Seci 8
`c c de.
`
`2. APPLICATION-LEVEL SECURITY
`We a by bie(cid:13)y caeg iig ad veyig a be
` f c a icai eve aack. We ake c ai
`egadig he c eee f hi vey; he v eabi iie
`high ighed hee ae a e eci f h e which we fee ae
`aic a y i a.
`Form Modification
` T f ae a a icai eve ec iy ie(cid:12)e d.
` w exei e idicae ha a igi(cid:12)ca eceage f
`web f ae v eab e a icai eve aack. The
` ai ea f hi i ha web deige i ici y
`va idai e which ae ef ced y he c ie ide.
`Exa e f c ie ide f va idai ic de b h c
`ai i ed by he T ie f e.g. he axegh a
`ib e ad ci a y avaSci ga which ae
`exec ed he c ie. f c e i acice e ca ea
`i y dify c ie ide va idai e hey h d eve
`be ed.
`The ae e a e f he TT c eave deig
`e wih he ak f aagig a icai ae ac
`i e e e. i fe eaie head ae h gh a
`eie f e e/e e ig hidde f (cid:12)e d ha i
`i e daa i a back ed daabae. Uf ae y ig
`hidde f (cid:12)e d i hi way eab e he c ie dify
`iea a icai ae eadig v eabi iie ch a
`he ice chagig aack decibed i he d ci . i
`ieeig e ha a eeced exb k T [21]
`ec ed hi dage acice wih ay ei
` f ec iy i e.
`F di(cid:12)cai i fe ed i c j ci wih he
`aack. F exa e chagig axegh c ai
`he c ie ay ex e b (cid:11)e ve ad S e
`he eve ide. f ai g eaed f ch fai e
`vide iigh i he iea c e f he ie ib y
`high ighig aea whee i i aic a y v eab e.
`A h gh wiig eve ide c de had e f i
`ec e y ay be ceeba y axig i i a edi i e
`c ig ad e e ak which i ae y deake
`c ec y if a a i acice.
`SQL Attacks
`Web a icai c y e daa ead f a c ie
` c c S eie. Uf ae y c cig he
` ey a(cid:127)(cid:16)ve y ead a v eabi iy whee he e ca
`exec e abiay S agai he back ed daabae. The
`aack i be i aed wih a i e exa e:
`C ide a E yee Diec y Webie wie i he
` a ciig ag age [3] which a e
` ee he a e f a e yee each f by ea
`
` f a f b x ca ed eacha e. he eve ide hi
`each ig ed i he vaiab e eacha e i ed
`b i d a S ey. Thi ay iv ve c de ch a:
`
` ey = "SEECT f ea ee faxe ai
`FR e a
`W ERE a e=‘ eacha e ; ";
`
`if he e ee he f wig ex i he
` weve
`eacha e f b x:
`
` ; SEECT aw de faxe ai FR e a
`W ERE a e=‘Sha
`
`he he va e f vaiab e ey wi bec e:
`
`SEECT f ea ee faxe ai FR e a
`W ERE a e=‘ ;
`SEECT aw de faxe ai FR e a
`W ERE a e=‘Sha ;
`
`Whe exec ed e S daabae hi wi e i
`Sha aw d beig e ed iead f hi f ea e.
`Eve if y a hah f he aw d i eaked a f wad
`each aack agai a adad dici ay ad a ea
`ab e chace f ec veig he ac a aw d.
`
`Cross-Site Scripting
`C Sie Sciig XSS efe a age f aack i
`which e b i a ici T ib y ic dig
`ci|e.g. avaSci dya ic web a icai . The
` a ici T ay be e bedded iide UR aa ee
`f (cid:12)e d c kie. Whe he e view he a ici
`c e i aea c e f he dya ic webie ie f
`a ed ce. The i icai f XSS ae evee; f
`exa e he Sa e igi icy a key a f avaSci
`ec iy de [12] i bveed.
`A CERT advi y CA 2000 02 [7] ie a age f e
`i aack which c e de he geea headig f XSS.
`The i f aack ic de ea ig c (cid:12)deia if ai
`e.g. ea e aw d cedi cad be a eig
`he behavi f f e.g. ig daa a cacke a
`chie ad ex ig SS Ecyed c eci . C ay e
`a . [9] decibe he deai f a ava/avaSci XSS aack
`which evea he addee f c ie ig a
`ed y a y daig evice.
` i we k w ha XSS v eabi iie ca be (cid:12)xed by
`ec dig T ea chaace2 ex ici y ig T
`#hi yax whee hi i he eica eeeai f
`he ec ded chaace. weve he (cid:13)exibi iy f T
` ake hi a e c icaed ak ha ay e e e
`a ie [8]. F he e f age a icai i i a ab i
`ad e e ak e e ha a i f he e
`ha bee a iae y T ec ded.
`2.1 Motivation and Contributions
` hi eci we dic a be f fac which c
`ib e he eva ece f a icai eve ec iy v e
`abi iie. We be ieve ha each f he b e ied be w
` i he a e i : he ec iy icy h d be
`a ied a a highe eve e vig ec iy e aed e
`ibi iie f c de wheeve ib e.
`
`2ea chaace ae h e which have ecia eaig
`wihi T. F exa e < ad > ae ed de i i
`ag.
`
`
`
`A aj ca e f a icai eve ec iy v eabi iie
`i a geea ack f ag age eve i a
`yed ciig ag age. F exa e c ide he a
`g age [3] ad VB Sci [24]. Whe ig hee a
`g age i i he j b f he ga e a a y veify
`ha a e i i a iae y T ec ded. ad
`vee y iig a ca he T ec dig f ci
`e i a v eabi iy beig i d ced. F age a i
`cai wie i ch ag age i i ieviab e ha a few
` ch v eabi iie wi cee i. e ha e ech
`gie vide geae ag age eve i hi eec:
`whe ig yed ag age ch a ava he ye ye
`ca be e yed aica y veify ha a e i ha
`bee aed h gh a T ec dig f ci ; e
`ai de (cid:11)e i i a g aaee b h gh i e
`check ahe ha c i e i e aa yi.
` f web a icai wee wie i a ig e ga ig
` ag age by a a be f deve e he e c d
`eaae he ec iy icy f he ai b dy f c de by
`abacig ec iy e aed ibay f ci behid a c ea
`A . weve i ea iy age web a icai fe c
`i f a age be f ieacig c e wie i
`di(cid:11)ee ga ig ag age by eaae ea f de
`ve e. T c icae he i ai f he e f hee
`c e ay be b gh i f hid ay deve e
` ib y i biay f . ch a evi e i i dif
`(cid:12)c abac c c de b ck i ibaie. The
`ieviab e c e ece i ha ec iy ciica c de i ca
`eed h gh he a icai i a c ed way.
`Thi ack f c e ake (cid:12)xig v eabi iie diÆc :
`he a e ec iy h e ay have be (cid:12)xed evea i e
`h gh he a icai .
`A he aj i e a bei a echica e i a ack
` f c ce f ec iy i he web deve e c iy.
`A h gh we ea ie ha hi i a geea iai evidece
` gge ha fac ch a i e ake gahic deig
`ad abi iy ae geea y c ideed highe i iy ha
`a icai eve ec iy. We ece y a ked wih e
`web deve e w kig f a age e ec icai c
`ay3; hey wee ied hea f he aack ied i
`Seci 2 ad had ake e ec agai he .
` hi ae we ee ad echi e which
`ec webie f a icai eve aack. Whi we ec g
`ie ha ed eh d gy i a aacea we
`c ai ha i d e he ec agai a wide age f
`c v eabi iie.
`
`3. TECHNICAL DETAILS
` ye c i f a be f c e:
`
`1. A ec iy icy decii ag age SD i ed
` ecify a e f va idai c ai ad af
` ai e.
`
`2. A icy c i e a aica y a ae he SD
`i c de f checkig va idai c ai.
`
`3. A a icai eve ec iy gaeway i ii ed be
`wee he web eve ad c ie achie.
`
`Fig e 1 h w a diaga aic view f he c e
` f ye ad he ieaci bewee he . e ha
`
`3We hae add ha hi wa ATT!
`
`Web Server
`
`Security Gateway
`
`Web Files
`
`Network
`
`Security Policy Compiler
`
`Clients
`
`SPDL Specification
`
`Fig e 1: A diaga aic view f ye f
`abacig a icai eve web ec iy
`
`he ec iy gaeway d e have a dedicaed
` achie: i c d be exec ed a a eaae ce he
`exiig web eve achieve bee ef ace ie
`gaed i he web eve diec y.
`
`3.1 System Overview
`A deige c de a e f va idai c ai ad a
`f ai e i SD. Va idai c ai ace e
`ici daa i c kie UR aa ee ad f .
`F exa e yica c ai ic de \he va e f hi
`c kie be a iege bewee 1 ad 3" ad \he va e f
`hi hidde f (cid:12)e d eve be di(cid:12)ed". The a
`f ai e f a SD eci(cid:12)cai a w a ga
` e ecify vai af ai e i . The
`kid f af ai which ay be eci(cid:12)ed ae \a
`daa f a (cid:12)e d f f h gh a T ec dig
`f ci " \ecae a ig e ad d b e e i ex
` b ied via hi UR aa ee". A deai ed decii
` f SD i give i Seci 3.2.
`The icy c i e a ae SD i c de which e
`f ce va idai e ad a ie he eci(cid:12)ed af a
`i . The geeaed c de i dya ica y aded i he
`ec iy gaeway whee i i exec ed i de ef ce he
`eci(cid:12)ed icy. The ec iy gaeway ac a a a icai
` eve (cid:12)ewa ; i j b i iece aa ye ad af
`wh e TT eage ee Seci 3.4. A we a check
`ig TT e e he ec iy gaeway a ewie he
` T i TT e e a aig i wih eage A
`heicai C de AC [27] ec ae which ay
`have bee a ici y di(cid:12)ed by c ie ee Seci 3.4.2.
`A h gh ef ig va idai check he eve ide
`i Æcie f ec iy e e ieface i e e
`i e e ie va idai e be a ied he c ie ide.
`F exa e web f fe e avaSci f c ie ide
`va idai ed ce he beved aecy bewee f b
` ii ad eceivig va idai e . T adde hi
`eed he icy c i e (cid:11)e he i f geeaig
`avaSci diec y f he va idai e f he SD
`eci(cid:12)cai . The ec iy gaeway aa ye f a hey
`ae e he c ie a aica y ieig avaSci va
`idai e whee a iae. Sice b h c ie ide ad
`eve ide va idai c de i deived f a ig e eci(cid:12)ca
`i deige y have wie he ec iy icy ce.
`Eve if he c ie ide avaSci i bveed hee ae i
`eve ide check i ace.
`
`
`
` e ha he ea we ie avaSci i f dy
`a ica y ahe ha ieig i aica y i (cid:12) e i he
`web e i y i ha ay a icai e eve ide
`c de geeae f he (cid:13)y. A h gh hee i c e
`f aa yi f web ciig ag age ie va idai
`c de aica y hi i a ic f f e w k.
`3.2 Security Policy Description Language
`A he eve a SD eci(cid:12)cai i a X d c
` e. The DTD c e dig SD i h w i Fig
` e 2. A icy e e e c ai a eie f UR ad c kie
`e e e. F each UR e e e a be f aa ee
`ae dec aed. The aib e f a aa ee e e e wih
`a e = ace c ai daa aed via :
`
`(cid:15) The ax egh ad i egh aib e ecify he
` axi ad ii egh f daa aed via .
`
`(cid:15) Seig e ied \Y" eci(cid:12)e ha a way
`c ai a ze egh va e;
`
`(cid:15) Seig AC \Y" eci(cid:12)e ha he va e f
`be acc aied by a eage A heicai C de
`AC [27] geeaed by he eve. Thi eve
`he e f chagig he va e f he aa ee
`abiay va e ee Seci 3.4.2.
`
`(cid:15) The ye aib e eci(cid:12)e he daa ye f eihe
`i f a b ig.
`
`The eh d aib e dee ie whehe he eci(cid:12)ed c
`ai a y aed a a GET aa ee i.e. a UR
`ag e a ST aa ee i.e. e ed f a f .
`Seig eh d GETadST ea ha he c ai
`wihi he aa ee e e e ae a icab e b h GET
`ad ST aa ee wih a e = .
`The GETadST
` i i aic a y ef if a f a web a icai
`ae wie i a ag age which d e f ce a diici
`bewee GET ad ST aa ee wih he a e a e|
`e.g. .
`F exa e c ide he f wig ec iy icy de
`cii :
`
`< icy>
`<UR efix="h://exa e">
`<aa ee a e="1" ax egh="4"
`ye="i" e ied="Y"
`AC="">
`</aa ee>
`<aa ee a e="2" eh d="ST"
` ax egh="3" ye="ig">
`</aa ee>
`</UR>
`</ icy>
`
`Thi exa e eci(cid:12)e c ai aa ee aed
`UR wih e(cid:12)x \h://exa e".
`The (cid:12) aa ee e e e de(cid:12)e c ai be a
` ied a aa ee a ed 1 eihe GET ST; he
`ec d aa ee e e e de(cid:12)e c ai be a ied
` a ST aa ee a ed 2.
`We h e ha he aib e f aa ee e e e c ve
`he aj iy f va idai c ai ha deige e ie.
` weve i e cic ace a geae degee f c i
`e ied: hi i vided by he va idai e e e. The
`
`va idai e e e a w c ex c ai be e
`c ded i a geea e va idai ag age. The c e
` f he va idai e e e i a va idai exei wie
`i a i e ca by va e a icaive ag age which i e
`eia y a i y yed be f Sadad [20]. e
`ha he ecie deai f he ag age ae he ai
`f c f hi ae. ici e ay ag age c d be ed
` exe va idai c ai. F ex i y e
`we ch e ake he ag age a i e a ib e.
`The abac yax f he va idai ag age i h w
`i Fig e 3. A we f ed va idai exei ha ye
`b ea. f he va idai exei f aa ee eva
` ae e he hi igi(cid:12)e ha c ai va id daa;
`c vee y eva aig fa e high igh a va idai fai e.
`Bad y yed va idai ga ae ejeced by a c i e
`i e ye checkig hae ee Seci 3.3. Wihi va ida
`i exei he va e f he (cid:12)e d eci(cid:12)ed i he e
`c ig aa ee e e e i efeed a hi. Va e f
` he dec aed GET ad ST aa ee ca be efe
`eced a geaa .a e ad aa .a e eecive y.
` hi way va idai e ca be deede he va e
` f i e aa ee.
`A be f i iive de(cid:12)ed f ci ad biay e
`a ae vided. A h gh we d i he a hee
`h e f aic a i ace ae ied be w:
`
`(cid:15) Aih eic ea ad / ca be a ied
`b h iege ad (cid:13) aig i va e. Sig c
`caeai i eeeed by he i(cid:12)x ea .
`
`(cid:15) The f ci f aegex e e i(cid:11) i f
`he f eci(cid:12)ed by eg a exei egex.
`
`(cid:15) We vide he f ci id which e he
` big f which a a chaace ad (cid:12)ihe
`a chaace ic ive y. Chaace f ae
`beed f 1.
`
`(cid:15) F ci ae vided ca bewee di(cid:11)ee ye.
`F exa e Sig.f i e he ig
`eeeai f iege i.
`
`(cid:15) F ci idefied ake a aa ee f exa
` e aa . geaa . ad e a b ea
`idicaig whehe i de(cid:12)ed i.e. ha bee aed
`he UR i he TT e e. Uig a de(cid:12)ed
`aa ee a a ag e ay he f ci
`ea ead a dya ica y geeaed e eage.
`
`Taf ai e ae ch i e ha va idai ex
`ei ad ae de i ied by he <af ai > ag.
`The c e f a af ai e e e eed wihi
`a aa ee e e e eci(cid:12)e a ie ie f af a
`i be a ied daa eceived via . F exa e if
`we a way waed a y af ai 1 f wed by
`2 aa ee aed via a give UR he SD
`eci(cid:12)cai w d c ai:
`
`<UR efix="...">
`<aa ee a e="" ...>
`<af ai > 1 | 2 </af ai >
`</aa ee>
`</UR>
`
`Taf ai ae e eced f a e de(cid:12)ed ibay.
` c e i e eai we have de(cid:12)ed he f wig
`af ai :
`
`
`
`<!EEET icy UR c kie>
`
`<!EEET UR aa ee>
`
`<!ATT ST UR efix CDATA #RE U RED>
`
`<!EEET aa ee va idai af ai >
`
`<!ATT ST aa ee eh d
`<!ATT ST aa ee a e
`<!ATT ST aa ee ax egh
`<!ATT ST aa ee i egh
`<!ATT ST aa ee e ied
`<!ATT ST aa ee AC
`<!ATT ST aa ee ye
`
`GET | ST | GETadST "GETadST">
`CDATA #RE U RED>
`CDATA #RE U RED>
`CDATA
`"0">
`Y | "">
`Y | "Y">
`i | f a | b | ig #RE U RED>
`
`<!EEET c kie va idai af ai >
`
`<!ATT ST c kie a e
`<!ATT ST c kie ax egh
`<!ATT ST c kie i egh
`<!ATT ST c kie AC
`<!ATT ST c kie ye
`
`CDATA #RE U RED>
`CDATA #RE U RED>
`CDATA
`"0">
`Y | "Y">
`i | f a | b | ig #RE U RED>
`
`<!EEET va idai #CDATA>
`
`<!EEET af ai #CDATA>
`
`<!ATT ST af ai h ec de Y | "Y">
`
`Fig e 2: The X DTD f he Sec iy icy Decii ag age
`
`e x
`j
`c
`j
`f e1; : : : ; ek
`j
`geaa :c
`j
` aa :c
`j
`hi
`j
`e1 h i e2
`j
`if e1 he e2 e e e3
`j
` e d : : : d i e ed
`
`vaiab e
`c a
`f ci ca
`va e f GET aa ee
`va e f ST aa ee
`va e f hi (cid:12)e d
`biay i(cid:12)x ea
`c dii a
` ca dec aai
`
`d va x : = e
`j
`f f x1 : ; : : : ; xk : : = e
`
`i ab e bidig
`f ci de(cid:12)ii
`
` i j f a j ig j b
`
`ye
`
`Fig e 3: The Abac Syax f he Va idai ag age
`
`
`
`EcaeSig e e Re ace a ig e e wih hei
` T chaace ec dig.
`
`Receive
`HTTP Request
`
`EcaeD b e e Re ace d b e e wih hei
` T chaace ec dig.
`
` TEc de T ec de he daa. Re ace ea
`chaace wih hei eica eeeai .
`
`aia TEc de T ec de he i b eave
`a a be f a wed ag ched ic dig
`y e ag <b> < > ad <i> ad ach f he f
`</a>.
`<a hef="..."> ...
`
`Faci iy i vided f he e de(cid:12)e he af a
`i ad ic de he i he ibay.
`We c ide he T ec dig af ai be
` f aic a i ace ice iadvee y f geig
` T ec de e i ead C Sie Sciig v
`eabi iie ee Seci 2. F hi ea we ad he
`c vei ha a aa ee ae T ec ded e
`ex ici y eci(cid:12)ed hewie i he ec iy icy. T
` (cid:11) T ec dig e e he h ec de aib e
` f he af ai e e e . F exa e e ay
`wie:
`
`...
`<af ai h ec de="">
`aia TEc de | EcaeSig e e
`</af ai >
`...
`
`Reca f Fig e 2 ha a he eve a SD de
`cii c i f a eie f UR ad c kie e e e. We
`have a eady dic ed UR e e e i deai ; i a i i a
`fahi c kie e e e a w deige ace va idai
`c ai c kie e ed f c ie achie.
`hi eeai we ake he i ifyig a i ha
`c kie ae g ba ac he wh e ie i.e. he ah a
`ib e f a Se C kie heade i TT e e ae
`e \/". Ude hee cic ace he c ie ed
`he va e f a he a icai c kie wih each TT
`e e. Sice a c ie ide ae i e he eve i each
`e e we ca geeae AC ec e y wih e iig
`eve ide ae i he ec iy gaeway ee Seci 3.4.2.
`3.3 Policy Compiler
`The icy c i e ake a SD eci(cid:12)cai a de
`cibed i Seci 3.2 ad c i e i f exec i he
`Sec iy Gaeway. Va idai e ad c ai ae a
`c i ed i avaSci eady be e bedded i f
`ad exec ed c ie.
`C i ai i ef ed i w ae. he (cid:12) a
`he dec aed aa ee ad hei ye ae e eaed; i
`he ec d a he c e f he va idai ad a
`f ai e e e ae c i ed. Uig a w a achi
`ec e a w he e f f wad aa ee efeece. F
`exa e c ide a UR e e e which c ai dec aa
`i f aa ee 1 ad 2 whee 1 i dec aed bef e
`2. i efec y acceab e f he va idai c de f a
`a ee 1 efe 2 ad vice vea.
`Va idai exei ae ye checked a c i e i e
`he ig e i iae e f SD va idai c de.
`he c e icaai f he ye va idai exei
`ae i y yed ha i we d a w aa eic y
` hi . weve h d exeiece h w hi be
`
`Check URL and
`parameter names
`
`Pass
`
`Apply
`transformations
`
`Type
`Checking
`
`Pass
`
`Check
`MAC
`
`Pass
`
`Execute
`Validation
`Code
`
`Fetch page from server;
`Modify HTTP Response
`
`Fail
`
`Fail
`
`Fail
`
`Return Error
`Page
`
`Return
`HTTP Response
`
`Fig e 4: The ak ef ed by he ec iy gae
`way
`
` i(cid:13)exib e hee i ea why e hiicaed
`ye ye e.g. y e y hi [19] c d
`be e yed i f e vei .
`3.4 The Security Gateway
`Fig e 4 h w he a g ih exec ed by he Sec iy
`Gaeway ecei f a TT e e. Fi he UR
`i exaced f he TT heade. Thi i ed e ec
`he a iae va idai e ad af ai a
` y. f he UR d e ach ay f h e eci(cid:12)ed i
`he ec iy icy he he e e i agaed
`he web eve ad a e age i e ed he e.
`By f biddig a UR ha d ach h e ex ici y
`i daabae we eve a cacke ig bc e
`adad UR ec dig echi e cic ve he ec
`iy gaeway h av idig aack f he kid ece y ed
` Cic i Deeci Sye [11]. Rejecig
`eci(cid:12)ed UR a vide a egieeig bee(cid:12): ice
`each UR e ie a c e dig SD de(cid:12)ii egi
`ee ae f ced kee he ec iy icy i yc wih he
`a icai .
` avig idei(cid:12)ed a va id UR he ec iy gaeway
`ceed check he a e f a aa ee ad c kie
`aed i he TT e e. E ae geeaed if i
`ay f he aa ee ee ae dec aed i he SD
` icy; ii ay f he e ied aa ee ae iig;
`iii he c kie ee d ecie y ach h e ec
`i(cid:12)ed i he SD eci(cid:12)cai . ce we ae e ha he
` TT eage c ai a va id c biai f c kie ad
`GET/ST aa ee ye ad egh c ai ae
`checked. f ay vi ai cc a hi age he a deci
`ive e eage i e ed he c ie. The ec iy
`gaeway he check ha he eage a heicai c de
`i va id. Seci 3.4.2 decibe hi ce i deai .
`ex he af ai eci(cid:12)ed i he ec iy icy
`ae a ied. Taf ai ae a f ci ig|
`we wie af ai c de h d geeae ex
`cei . weve if a bad y wie af ai f c
`i d e geeae a i e excei he he ce i
`ab ed ad a e eage i e ed he c ie. Fi
`a y a va idai exei ae eva aed. f a f he
`va idai exei eva ae e he he TT e
` e i f waded he web eve ad he age i feched.
`The ec iy gaeway cee TT e e e ed
`f he web eve: avaSci va idai c de geeaed
`
`
`
`by he SD c i e i ieed i T f ee
`Seci 3.4.1 axegh aib e f e e e ae
`e acc dig he SD eci(cid:12)cai ad (cid:12)a y eage
`a heicai c de ae geeaed f f (cid:12)e d ad UR
`aa ee ee Seci 3.4.2 if e ied.
`
`3.4.1 Client-side Form Validation
`F each T f i he TT e e he ec
`iy gaeway ie avaSci c de ef va idai
`check he c ie achie. Reca ha he iei
` f avaSci i ee y ehace abi iy|he geeaed
`avaSci i c ideed a bi e f eve ide va
`idai checkig.
`The ce f ieig va idai avaSci f
`iv ve he f wig e:
`
`1. The ec iy gaeway ca he T f <f > ag
`ad exac he deiai UR f he f aci
`aib e.
`
`2. F hi deiai UR he va idai c ai
` a y f (cid:12)e d ae dee ied. e ha we
`a have k a he f eh d aib e
`dee ie whehe he (cid:12)e d wi be e a GET
`ST aa ee.
`
`3. A avaSci va idai ga i c ced by c
`caeaig e c i ed avaSci fag e: e f
`each f he (cid:12)e d he f . The avaSci c de
`ha a eady bee geeaed by he icy c i e|
`ee Seci 3.3.
`
`4. The avaSci va idai ga i ieed i he
` S b i aib e f he f ag.
`
` f hee i a eady a S b i aib e ee he he
`ec iy gaeway d e ie he va idai ga .
`We ake he view ha if a f a eady ha a S b i
`aib e he hi ve ide he a aica y geeaed
`va idai avaSci.
`A we a ex ici y ef cig he check eci(cid:12)ed i he
`va idai e e e f SD eci(cid:12)cai he va idai
`avaSci a ef ce ye checkig e ef ce i
` egh c ai ad e e ha a e ied (cid:12)e d c
`ai daa. e ha we d have w y ab ax
` egh c ai ice hee ae ieed diec y a T
`aib e.
`
`3.4.2 Message Authentication Codes
`We have a eady ee ha a SD eci(cid:12)cai ca de
`c ae ha ceai UR aa ee y c ai daa
`acc aied by a eage A heicai C de AC [27]
`geeaed by he ec iy gaeway. A daa i e he
`c ie he ec iy gaeway a ae i wih AC; a daa
`i e ed