• No results found

Model-Based Vulnerability Testing for Web Applications

N/A
N/A
Protected

Academic year: 2021

Share "Model-Based Vulnerability Testing for Web Applications"

Copied!
23
0
0

Loading.... (view fulltext now)

Full text

(1)

for Web Applications

F. Lebeau, B. Legeard, F. Peureux, A. VERNOTTE

FEMTO-ST Institute / University of Franche-Comt´e UMR CNRS 6174, 25030 Besancon, France.

Smartesting R&D Center, 25000 Besancon, France.

SecTest 2013, Luxembourg March 22, 2013

(2)

Introduction

Current Dynamic Application Security Testing Techniques Model-Based Vulnerability Testing

Detailed Process with Example Discussion

Conclusion

(3)

Web evolution and Security

Continued growth and complexity of the internet:

I increasing ubiquity of uses (banking, e-commerce, social...)

I increasing combination of technologies(server, client)

→maintaining security is a real challenge

An urgent issue: Web Application vulnerabilities

The later a vulnerability is found, the more expensive it is to fix.

⇒Vulnerability discovery part of the development process.

Two main techniques:

I SAST: Static Application Security Testing

(4)

Web evolution and Security

Continued growth and complexity of the internet:

I increasing ubiquity of uses (banking, e-commerce, social...)

I increasing combination of technologies(server, client)

→maintaining security is a real challenge

An urgent issue: Web Application vulnerabilities

The later a vulnerability is found, the more expensive it is to fix.

⇒Vulnerability discovery part of the development process.

Two main techniques:

I SAST: Static Application Security Testing

I DAST: Dynamic Application Security Testing

Penetration Testing Scanners Fuzzing

Model-Based Security Testing

(5)

Current DAST techniques

Manual/Tool-Based Penetration testing

Strengths

I Precise and Reliable to detect design flaws

I Based on insights and experience

Weaknesses

I Fastidious (thorough testing for XSS)

I Constant need of manpower and expertise

I Based on insights and experience

D. Allan,Web application security: automated scanning versus manual penetration testing, Somers, IBM White Paper, 2008

(6)

Current DAST techniques (2)

Vulnerability Scanners

Strengths

I Point-and-shoot solutions

I Efficient for a majority of technical vulnerabilities

Weaknesses

I Suffer from a fair amount of false positives

I Struggle with complex vulnerabilities (Multi-step XSS)

I Struggle with vulnerabilities related to business logic

A. Doup´e et. al.,Why Johnny can’t pentest: An analysis of black-box web vulnerability scanners, Journal of Detection of Intrusions and Malware, and Vulnerability Assessment, pp 111–131, Springer, 2010

(7)

Current DAST techniques (3)

Black-box Fuzzing

Strengths

I Low cost solution

I Efficient to spot unattended behaviors (or “black swans”)

Weaknesses

I Weak Oracle (crashes, freezes)

I Improving the Oracle is challenging

R. McNallyet. al.,Fuzzing: The State of the Art: DSTO-TN-1043, DSTO Formal Reports, 2012

(8)

Existing DAST techniques (4)

Model-Based Security Testing

Strengths

I Efficient to address functional security properties

I Automation capacity

I Handle well application evolution

Weaknesses

I Needed effort to provide models

I Needed effort to develop a concretization layer

I. Schieferdecker,Model-Based Fuzz Testing, Invited talk of the

5th IEEE Int. Conf. on Software Testing, Verification and

Validation, 2012

(9)

Model-Based Vulnerability Testing (MBVT)

MBVT:Vulnerability testing based on models andtest patterns.

Goal: Improve theaccuracy andprecisionof vulnerability testing.

Accuracy

Capability to focus on the

rel-evant part of the software

(e.g. from a risk assessment

point of view) depending on the

targeted vulnerability types.

Precision

Capability to avoid both false

(10)

MBVT Overall Process

This MBVT approach is composed of 4 activities:

1. Test purpose definition

2. Model design

3. Test generation

4. Concretization, test execution and verdict

assignment

(11)

Challenge: Multi-step XSS Discovery

OWASP TOP 10 2013 A1 - Injection A2 - Broken Authentication and Session Management A3 - Cross-Site Scripting (XSS) A4 - Insecure Direct Object References A5 - Security Misconfigura-tion A6 - Sensitive Data Exposure A7 - Missing Function Level Access Control A8 - Cross-Site Request Forgery (CSRF) A9 - Using Components with Known Vulnerabilities A10 - Unvali-dated Redirects and Forwards

Multi-step XSSis a challenging vulnerability for automated tools1.

→It requires knowledgefrom the targeted application.

This MBVT approach deals with this class of vulnerability, by

applying a“Def/Use” approach (All-def criterion).

Experiments have been conducted on WackoPicko.

(12)

1 - Test Purpose Definition

Vulnerability Test Patterns (vTP) are theentry-pointof MBVT:

I Based on a study from the ITEA2 DIAMONDS project

I Express testing needs and procedure to highlight a breach

The goal is totranslatevTP into a machine-readable language.

⇒Reuse of theSmartesting Test Purpose Language2:

I Designed for security means

I Textual language based on regular expressions

I Reasons in term of states to be reach and operations to be

called

2J Botellaet. al.,MBT of Cryptographic Components, Lessons Learned

from Experience, ICST 2013.

(13)

Test Purpose for Multi-step XSS

Translation from vTP to test purposes Name Multi-step XSS Description ...

Objective(s) Detect if an input can embed malicious datum enabling a Multi-step XSS attack.

Prerequisites N/A

Procedure Identify a sensible user input, inject the malicious datum<script>alert(rxss)</script>.

Oracle Find the page where the input is rendered, and check if a message box ’rxss’ appears.

Variant(s) ...

Known Issue(s) ...

Affiliated vTP Reflected XSS Reference(s) ...

(14)

2 - Model Design

MBVT behavioral notation is based onUML4MBT3.

A generic class diagramdepicts the structure of the SUT: pages, actions, and in/out data (following the def/use concept).

MBVT also requires:

I Class Diagrams: defines the static aspect of the SUT

I Object Diagrams: defines the initial state of the SUT

I State Diagrams: defines the dynamic of the SUT

3

F Bouquetet. al.,A subset of precise UML for model-based testing, 2007. A. Vernotteet al. MBVT for Web Applications - SecTest’13 13 / 22

(15)

Modeling: WackoPicko Example

Class Diagram

(16)

3 - Test Generation

Test cases are generated usingSmartesting CertifyIt.

Test generation process is driven bytest purposesand models:

I Test generator unfolds test purposes

I Models give the path to follow in order to reach each stages

of a given test purpose

Result: A suite of abstract vulnerability test cases

(17)

4 - Execution and Verdict Assignment

Human Intervention during concretization:

I List of malicious vectors (xml file)

I Body of the SUT’s operations (HTTP level, Browser level)

Observation Technique for XSS: crawl the source page to see if the injected vector has been sanitized.

Test terminology dedicated to Vulnerability Testing:

I Test verdict is OK → Attack-pass: System is vulnerable

(18)

Early Results on WackoPicko

Experiment on Multi-Step XSS testing:

I 1 test purpose

I 2 abstract test cases:

I login input

I comment input

I 210 test executions:

I 105 variants retrieved from OWASP’s XSS Cheat Sheet

I Results:

I All failed for login input

I 85 Successes / 20 fails for comment input Concordant with our manual experiments.

⇒0 false positive,0 false negative

(19)

Early Results on a real application

Application Under Test presentation:

I Virtual Learning Environment

I Highly used by french learning academies (> 90%)

I More than 15000 users

Experiment on Multi-Step XSS testing:

I 1 test purpose

I 11 abstract test cases

I 1155 test executions:

I 105 variants retrieved from OWASP’s XSS Cheat Sheet

I 16 steps per test case

I 8 steps between injection and observation Concordant with our manual experiments.

(20)

Discussion

MBVT appears as an accurate and precise technique. It also has its limitations, inherited from MBT:

I Needed effort to provideModels

I Needed effort to design Adaptation

Potential solutions:

I Use of abehavioral crawler to infer most parts of models

I Use of User traces to complement the results of the crawler

I Identify the reusability capacity of each artifact

(21)

Discussion

MBVT does not suit every vulnerability type.

⇒MBVT Scope based on OWASP TOP 10 2013:

A1 - Injection

A2 - Broken Authentication and Session Management A3 - Cross-Site Scripting (XSS)

A4 - Insecure Direct Object References A5 - Security Misconfiguration A6 - Sensitive Data Exposure

A7 - Missing Function Level Access Control A8 - Cross-Site Request Forgery (CSRF)

A9 - Using Components with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards

Legend

Done Doable Out of scope Under study

(22)

Conclusion and Future Works

MBVT is a novel technique for Dynamic Application Security Testing.

Goal

To improve the precision and accuracy of

vulnerability testing.

First Approach

I vTP into Test purposes

I Modeling of the SUT

I Test cases fed with a vectors battery

Limitations

Needed effort to provide models and design adaptation layer.

Work in Progress

Model inference, User traces, generic artefacts, test purposes extensions, real-life applications experiments.

(23)

Thank you for your attention

References

Related documents

The Continuing Education Center in collaboration with the College of Graduate Studies offers training courses specifically de- signed for graduate students who have been

Evaluation of effectiveness of Ponseti's method in the clubfoot management under 1-year children: a prospective study.. Prateek

As a result of analyzing the competitive role, the potential economic development effects and the economic-social environment of univer- sities we can create the virtual model

As indicated in the table the entry level VSC50 service, is provided with a 1GB Internet bundle with a maximum download speed of 512kbps and an upload speed of 128kbps with the

The adder circuit provides an output voltage proportional to or equal to the algebraic sum of two or more input voltages each multiplied by a constant gain factor.. It is

Given the costs and logistical challenges of repeatedly measuring EF across early childhood, a corollary question was whether the identification of children who exhibited

Two-sided pockets for the prosthesis made from cotton with antibacterial finish, multi-level adjustment of circumference size and extended, comfortable shoulder straps which

on the study of the acceleration of the body is considered to be valid and reliable for predicting the risk of falling or for discriminating between population groups with