中国IDC产业年度大典---基于语义的WEB访问安全检测--下

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1ValidatingWebAccessingWithSemanticconstraints基于语义的WEB访问安全检测胡振宇工信部NSACE项目技术专家启明星辰资深工程师2SemanticSecurity-Informally•DifferentstructuresmayhavethesamesemanticsQueryWHEREANDaccounts=SELECTcardnumFROM=unamejohncardtype+ChangedSQLsyntacticaltree211SELECTcardnumFROMaccountsWHEREuname='John'ANDcardtype=1+123SemanticSecurity-Informally•Thesyntaxisconcernedwiththeformofexpressionswhichareallowedinthelanguage.•Thesemanticdefinitioncoulddescribetheeffectofexecutingorevaluatinganysyntacticallycorrectexpressionorprogram,oritcoulddescribehowtoexecuteorevaluatethem.•Theessenceofwebapplicationsecurityisthesemanticsecurity(i.e.invalidationoftheintendedsemantic)4SemanticSecurity-Formally•Awebapplicationisafunctionwhichinputsn-tuplesofstringsandoutputsaqueryexpress•Ifthequeryexpressproducedbythewebapplicationcannotresultinviolationofintendedsemantic,theuserrequestiscalledsemanticsecurity.1(,,)nWebstrstrQueryexpress“红楼梦”,“2”“INSERTINTOorders(title,amount,cost)VALUES(‘红楼梦’,2,2*50)”5SemanticSecurity-Formally•The(denotational)semanticofaprogramisdetermineduniquelybyitssyntacticstructureandthesemanticofitems.•Justasthesyntactictree,thesemanticoftheprogramcanalsoberepresentedasaparsetree,whichwecalledassemantictree.6SemanticTemplate•Aprogramsemanticcanbeconductedbyconstrainingthesemanticofitemsinasyntacticstructure–Morespecifically,thesemanticofaprogramcanbedetonatedbyconstraintorassignthesemanticsofleafnodesinthesyntactictree.•Asyntactictreewithsemanticallyconstrainedleafnodesiscalledasemantictemplate.7SemanticTemplateBoxedCharactersimplysemanticconstraintsofuser’sinputsQueryWHEREANDaccounts=SELECTcardnumFROM=unamenamecardtypetypeSemantictemplateofaSQLqueryIntegerString8SemanticTemplate•Thesemantictemplateoforderproblem红楼梦QueryVALUES(title,amount,cost)INSERTINTOordersSQLsemantictemplateforordering*amountprice()500Integer10009SemanticValidation•ForeveryHTTPrequest,validatethequerystringproducedbythewebapplication.•Validatethesemanticofthequerystringtoconfirmthatusersubmissioncannotcauseanyunintendedsemanticwhenexecutedbythebackenddatabase10ValidationAlgorithm•Step1.Parsethequerystringassyntactictree;•Step2.Inthequerytree,cutoffalltheleavesthataredeeperthanthedepthofsemantictemplatetree;•Step3.Ifthetrimmedquerytreeisisomorphicwiththetemplatetree,and•Step4.Thesemanticofeachleavesofthetrimmedquerytreeisconfinedwithinthesemanticofthecorrespondedleavesofsemantictemplatetree,then•Step5.Thequeryissemanticsecurity11Implementation•Toformvalidsemantic,theuserinputsshouldbe–leavesofthesemantictemplatetree,–childrenofleavesofthesemantictemplatetree.•Sotheresultsemantictemplatecanbeconvertedintothesemanticconstraintsoftheuserinputs—usertemplate.12CaseStudy•Theusertemplatefortheorderingproblemisas:–name:type=string,maxlength=20,value=红楼梦,alterable=no;–amount:type=integer,constraint=“0and1000”;–price:type=float,value=50.00,alterable=no13Applications•SQLinjection•XSSinjection•Formmodification•XPathinjection•Shellinjection14ChallengeandFurtherWork•Constructionofsemantictemplate–Manually–Automatically–Hybridly•Furtherevaluationthetechnology15谢谢!

1 / 15
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功