WebApplicationSecurity—Past,Present,andFuture*Yao-WenHuang†andD.T.Lee‡InstituteofInformationScience,AcademiaSinicaNankang115,Taipei,Taiwan{ywhuang,dtlee}@iis.sinica.edu.twAbstractWebapplicationsecurityremainsamajorroadblocktouniversalacceptanceoftheWebformanykindsofonlinetransactions,especiallysincetherecentsharpincreaseinremotelyexploitablevulnerabilitieshasbeenattributedtoWebapplicationbugs.Insoftwareengineering,softwaretestingisanestablishedandwell-researchedprocessforimprovingsoftwarequality.RecentlyformalverificationtoolshavealsoshownsuccessindiscoveringvulnerabilitiesinCprograms.InthischapterweshalldiscusshowtoapplysoftwaretestingandverificationalgorithmstoWebapplicationsandimprovetheirsecurityattributes.TwoofthemostcommonWebapplicationvulnerabilitiesthatareknowntodatearescriptinjection,e.g.,SQLinjection,andcross-sitescripting(XSS).Wewillformalizethesevulnerabilitiesasproblemsrelatedtoinformationflowsecurity—aconventionaltopicinsecurityresearch.Usingthisformalization,wethenpresenttwotools,WAVES(WebApplicationVulnerabilityandErrorScanner)andWebSSARI(WebApplicationSecurityviaStaticAnalysisandRuntimeInspection),whichrespectivelyutilizesoftwaretestingandverificationtodealinparticularwithscriptinjectionandXSSandaddressingeneraltheWebapplicationsecurityproblems.Finallywewillpresentsomeresultsobtainedbyapplyingthesetoolstoreal-worldWebapplicationsthatareinusetoday,andgivesomesuggestionsaboutthefutureresearchdirectioninthisarea.1.INTRODUCTIONAsWorldWideWebusageexpandstocoveragreaternumberofB2B(business-to-business),B2C(business-to-client),healthcare,ande-governmentservices,thereliabilityandsecurityofWebapplicationshasbecomeanincreasinglyimportantconcern.InaSymantecanalysisreportofnetwork-basedattacks,knownvulnerabilities,andmaliciouscoderecordedthroughout2003[49],eightofthetoptenattackswereassociatedwithWebapplications;andthereportalsostatedthatport80wasthemostfrequentlyattackedTCPport.InadditiontoholdingWebapplicationsresponsibleforthesharpincreaseinmoderatelyseverevulnerabilitiesfoundin2003,theauthorsofthereportalsosuggestedthatWebapplicationvulnerabilitieswerebyfartheeasiesttoexploit.Webapplicationinsecurityisattributedtoseveralfactors.Firstly,theWeb,whichwasinitiallydesignedasadata-deliveryplatform,hasquicklyevolvedintoacomplexapplicationplatformontopofwhichmoreandmoresophisticatedapplicationshavebeendeveloped.Asaresult,Webspecificationshavegrownrapidlytomeetrisingdemands,andbrowsersandWeb-developmentlanguagesfoughta“featurewar”towinmarketshare.Unfortunately,securityissueshavebeenleftasanafterthought.Thefast-expandedfeaturesdidhelpWebgrowth;however,manysecuritysideeffectstheyinducedhavebecometoday’smajorconcernforWebadoption.Secondly,sincesoftwarevendorsarebecomingmoreadeptatwritingsecurecodeanddevelopinganddistributingpatchestocountertraditionalformsofattack(e.g.,bufferoverflows),hackersareincreasinglytargetingWebapplications.WebapplicationvulnerabilitiesarehardtoeliminatebecausemostWebapplicationsa)gothroughrapiddevelopmentphaseswithextremelyshortturnaroundtime,andb)aredevelopedin-housebycorporateMISengineers,mostofwhomhavelesstrainingandexperienceinsecuresoftwaredevelopmentcomparedtoengineersatIBM,Sun,Microsoft,andotherlargesoftwarefirms.Lastly,currenttechnologiessuchasanti-virussoftwareandnetworkfirewallsoffercomparativelysecureprotectionatthehostandnetworklevels,butnotattheapplicationlevel[24].Whennetworkandhost-levelentrypointsarerelativelysecure,thepublicinterfacestoWebapplicationsbecomethefocusortargetsofattacks[68][24].TwoofthemostcommonWebapplicationvulnerabilitiesarescriptinjection(e.g.,SQLinjection)andcross-site—————————————————†alsowiththeDeptofElectricalEngineering,NationalTaiwanUniversity‡alsowiththeDeptofComputerScienceandInformationEngineering,NationalTaiwanUniversity*ThisworkwassupportedinpartbytheNationalScienceCouncilundertheGrantsNSC-93-2213-E-001-013,NSC-93-2422-H-001-0001,andNSC-93-2752-E-002-005-PAEscripting(XSS).InthischapterweshallfirstprovideabriefdescriptionofXSSandscriptinjectionvulnerabilities.ThereaderisreferredtoScottandSharp[98][99],Curpheyetal.[24],andMeieretal.[68]formoredetails.Wethendescribepossibleautomatedapproachestoeliminatingoratleastdetectingsuchvulnerabilities.Finallywewillgivesomeconcludingremarksandpresentafewpossibleavenuesforfutureworkinthisarea.1.1Cross-SiteScripting(XSS)OnFeb2,2000,CERTCoordinationCenterissuedanadvisory[18]on“cross-sitescripting”(XSS)attacksonWebapplications.Thishard-to-eliminatethreatsoondrewtheattentionandspawnedactivediscussionsamongsecurityresearchers[79].DespitetheeffortsofresearchersintheprivatesectorandacademiatopromotedeveloperawarenessandtodeveloptoolstoeliminateXSSattacks,hackersarestillusingthemtoexploitWebapplications.AstudybyOhmaki(2002)[80]foundthatalmost80percentofalle-commercesitesinJapanwerestillvulnerabletoXSS.AsearchonGoogleNews()forXSSadvisoriesonnewlydiscoveredXSSvulnerabilitieswithinthemonthofMarch2004aloneyielded24reports.AmongthesewereconfirmedvulnerabilitiesinMicrosoftHotmail[108]andYahoo!Mail