DOC PREVIEW
Purdue CS 59000 - Study notes

This preview shows page 1-2-14-15-30-31 out of 31 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Using Programmer-Written Compiler Extensions to Catch Security HolesOutlineMotivation (1)Motivation (2)Example: Range Checker (1)Range Check (2)Range Check (3)Range Check (4)Implementation (1)Implementation (2)Implementation (3)AdvantagesAbout the checkerBelief InferenceDriving Untrustworthy SourcesDeriving Trusting SinksNetwork DataAnalysis – Transitive TaintingAnalysis – Inter-procedural Analysis (1)Analysis – Inter-procedural Analysis (2)Analysis – False PositivesAnalysis – False NegativesEnforcing Obscure Rules (1)Enforcing Obscure Rules (2)Evaluation (1) – Errors OverviewEvaluation (2) – Errors OverviewEvaluation (3) – Results ValidationDiscussion (1)Discussion (2)Slide 30ReferenceUsing Programmer-Written Compiler Extensions to Catch Security HolesAuthors: Ken Ashcraft and Dawson EnglerPresented by : Hong ChenCS590F2/7/2007OutlineMotivationExample: Range CheckerSolution DetailsBelief InferenceAnalysis IssuesEnforcing Obscure RulesEvaluationDiscussionMotivation (1)ProblemFind security holes (security rules violation) in source code of system softwareSecurity rulesSanitize untrusted input before using itDo not release sensitive data to unauthorized usersObservationMany rules are poorly understood and erratically obeyedApproachUse static analysis to check if security rules are obeyedMotivation (2)Program analysis: Intuition  ToolSecurity rulesDomain specificSystem specificHigh-levelMetacompilationMake it easy for programmer to add rulesExample: Range Checker (1)Security ruleIntegers supplied by untrustworthy sources should be range-checked before used for dangerous operationsRange Check (2)Checker needs to identifyUntrustworthy sources that generate dataChecks must be done to sanitize the dataTrusting sinks that must be protectedUntrustworthy sourcesSystem calls (sys_*)Routines copy data from user space (copy_from_user, copyin) Data from networkRange Check (3)Sanitizing dataSigned integers: lower and upper boundUnsigned integers: upper bound checkTricky: integer overflowRange Check (4)Trusting sinksArray indexLoop boundCopying/allocation routinesPotentially 3 x 3 x 3 = 27 types of security holes!Implementation (1)Implementation (2)State machine representationMetal: high-level, state-machine languageCompilation extension linked to xgcc States can be global or bound to expressionsHow it works?“After xgcc translates each input function into its internal representation, the checker is applied down every possible execution path in that function”Implementation (3)AdvantagesPropagate the knowledge of one programmer to manySecurity rules are subtleFind difficult-to-observe errorsCatch error without running codeMany errors are found in the driversLightweightAbout the checkerAd hoc knowledge (security rules)Effective (range checker finds 100+ errors in Linux)False negativeFalse positiveBelief InferenceTraditional checkers:Hardwired knowledgeMC:Use code behavior to infer checking properties InferenceUntrustworthy sourcesTrusting sinksNetwork DataDriving Untrustworthy SourcesChallengesThere are many untrustworthy sourcesDifficult to analyzeUse inferenceUntrustworthy input is often used in stylized waysDeriving Trusting SinksNormal checking sequence(1) OS reads data from unsafe source(2) Check the data(3) Pass it to a trusting sinkWhat if (3) is missing?Something may be wrong…Network DataChallengeNetwork data is not trustworthysk_buff holds network dataIncoming or outgoing?CandidatesIf the fields were read more often than written, the structure is incomingIf the checker sees the allocation of the structure, it’s outgoingAnalysis – Transitive TaintingAllow tainted variables to transitively taint other variablesAnalysis – Inter-procedural Analysis (1)The user only provides the “base” unsafe sources and trusting sinksAutomatically compute all procedures that transitively produces or consumes dataTwo-pass processFirst pass: Emit a call graph, compute the transitive set of functions, store calculated sources and sinks in text filesSecond pass: at call sites, taint variable / report errorsSpecial case: function pointersAnalysis – Inter-procedural Analysis (2)Analysis – False PositivesChecker designFirst write simple checkersEliminating false positivesCommon false positives“Fancy” bound checksTaint granularitySubroutine checks boundsAnalysis – False NegativesFirst of all, false negatives are expected…Potential improvementsComparison with correct valueOther information flow channel (tainted value stored in data structure)Info lost during inter-procedure analysisOnly local inferenceEnforcing Obscure Rules (1)The length-field copy attackSigned integer must be lower and upper bound checkedEnforcing Obscure Rules (2)Integer overflowFixed size arithmeticEvaluation (1) – Errors OverviewSevere erros as common as minor onesEvaluation (2) – Errors OverviewMost bugs are localLow false positive rateEvaluation (3) – Results ValidationLinux (2.4.5 – 2.4.12)Post errors to Linux KernelCount unique errorsMany resulted in kernel patchFalse result – kernel developers will explain whyMinor bugs – may introduce possibility of new bugsOpenBSD (2.9)Submitted to a local BSD hackerAll errors resulted in kernel patchesTotal kernel patches 50+Discussion (1)Core techniquesStatic analysis – State Machine model, although implementation details are not given (see details)Make ad hoc knowledge powerfulBelief inference (save effort to specify everything)Extract information from source code presentationDiscussion (2)How to do better?Static analysis (other models/tools?)Finding errors (combine with dynamic analysis?)Other applicationsFinding bugs (past work)…Thank you ReferenceUsing Programmer-Written Compiler Extensions to Catch Security HolesKen Ashcraft and Dawson Engler In Proceeding of IEEE Security and Privacy


View Full Document

Purdue CS 59000 - Study notes

Documents in this Course
Lecture 4

Lecture 4

42 pages

Lecture 6

Lecture 6

38 pages

Load more
Download Study notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?