SlideShare a Scribd company logo
©2018TrustInSoft
Benjamin Monate
Co-founder of TrustInSoft and CTO
Applying formal
methods to
existing
software: what
can you expect?
6/27/2018
©2018TrustInSoft
2
Sound Static Analysis
aka formal methods to prove properties of software
Works for Safety Critical Software
• Consequences of failures are analyzed fromthe beginning
• Regulation is strong: standards and associated liability
• Adapted development process: specific languages/dev. cycles
• Software errors mitigated with systemarchitecture
àconsidering probability of failure
©2018TrustInSoft
3
Sound Static Analysisfor Security Critical
Software?
• Meanings of failure probability?
àadversary defies standard distributions of the software input
• One single error àarbitrary corruption
• Confidentiality: secrets must not escape software
• Software already deployed in production: barely tested for security
- Because testing security is hard: looking for behaviors that have undefined
consequences but are most of the time invisible
- Observing a data leak is difficult: where shall it be observed? How shall one
recognize that some bits are part of a secret?
©2018TrustInSoft
4
TrustInSoft pragmatic and incremental security
Each level requires someprevious ones to bemeaningful
TrustInSoft Analyzer addresses Level 2 up to Level 5
Confidence
Level
Property Tool Guaranteed properties
Level 1 Each compilation
unit compiles
Compilers with warnings Statictypingand syntacticcompliance
Level 2 Integrity of link Sound SourceLinker Consistency of compilationunits (ODR/static inline/weak)
Level 3 Only defined
behaviors
Sound StaticAnalyzer Absenceof undefined behaviors/Integrity
Compilers optimizations makes the consequences more and more
dangerous
Level 4 Dataflowintegrity Sound StaticAnalyzer Absenceof unwanted data flows/Confidentiality
Level 5 Functional
correctness
Sound Functional
Verification
Programfulfills its functional specification
©2018TrustInSoft
5
Howto reach these levels on legacy code?
• Level 1 for free
• Level 2 automatic with TrustInSoft Analyzer: just provide all source files
May be detected by modern binary-level LTO
Reduced example fromXen
file1.c: int GlobalConfig[255] = { 0 };
file2.c: extern int *Globalconfig;
• Level 3 not easy to get because
- Soundness: false alarms, not the most important problem
- Programs contain bugs: must be fixed to give semantics
©2018TrustInSoft
6
Methodology toward Level 3 security
Do not explore all execution paths at once, but
• Explore simple path: rely on existing test-suite
• Fix all discovered bugs
- Unliketesting: detect invisibleundefined behaviors
àInvisiblebut may hidesecurity bugs thanks to compiler optimization/platform
specificities
- No need to befully deterministic: external functions/hardwareare stubbed
- Useanexistingtest to reach somedifficult-to-reach programpoints (after SSL
certificatevalidation) and theninvent newtests by mutating the input data that do not
changetheinitial paths (fuzzing, manual testing)
- Generalizethetests progressively àfix bugs one after the other
- Maybe one reaches a state where all behaviors are covered
àBut if onedoes not, thesecurity is still vastly improved, step-by-step
©2018TrustInSoft
7
Howlong does it take to get a proof of
absence of undefined behaviors?
• Major industrial question: ROI, Time To Market, Total Cost of Ownership
• Important but flawed question:
- It takes the time that one needs to fix all the discovered bugs
- No one knows howto evaluate this soundly
• Cyber-security is incremental
- Soundness does not mean: “all questions answered”
- Soundness does mean: “some questions answered definitively”
Not necessarily “the” whole question
©2018TrustInSoft
8
Examples: tooling funded for zero false positive
and zero false negative source code analysis
Hundreds of security bugs discovered: most of themfixed upstream
• Initial analysis: existing test-suites
• Further analysis: AFL fuzzing
• Next steps: generalized input to reach more behaviors
Invalid memory accesses, signed overflows, uninitialized data, double free, strict aliasing violations,
constant execution time…
OpenSSL, Amazon S2N, Google Libwebp, expat, libpng, SQLite, musl,
libjpg, libsodium, LibreSSL, tiny ssh, libxml, zlib, ntpd, libbzip2,
dpdk, nova, libksba
©2018TrustInSoft
9
Examples: subtle bug in Google’s libwebp
• Invalid pointer computation: invisible UB
• Followed by invalid pointer comparison
- result depends on memory layout
- If the result is wrong, out-of-bound access occurs
• LLVMASan statistically uses the memory layout without consequences
• TrustInSoft Analyzer’s soundness means: all memory layouts are explored
©2018TrustInSoft
10
Full Level 3 is reachable
Proof of absence of UBs for some configurations of mbed TLS
Read the full technical report at https: //trust-in-soft.com/polarssl-verification-kit/
©2018TrustInSoft
11
Good news for cyber-security
• These examples are the most difficult software to analyze
- Huge legacy, multi-purpose code bases
- No developer was involved in the analysis: only bug reports
- Time to convince developers/maintainers that fixing issues is important
• And still: it works!
Security is improved: fewer bugs and unmodified dev. process
• In the industry, this is much simpler!
©2018TrustInSoft
12
Level 4 : Dataflowintegrity
Example: look for the sources of randomnumbers in OpenSSL
Explicit security property: Random generators seeds are acceptable
- Customer knows what "acceptable" means
- Tools can extract the origin of the data: sound means exhaustive
Findings: a dozen of sources are used, including the private certificate
Customer conclusion: we must configure the stack to avoid this
Classical security analysis: define attack surfaces and implement proper mitigations
This works onthesourcecode, if security expressed interms of programs behaviors
©2018TrustInSoft
13
Level 5: full specifications for all functions
Kind of a Grail for programcorrectness
• We support this usage
• Impacts the dev. Cycle:
- Produce specifications
- Check specifications
àsoftware developed to make it provable maybe with dedicated languages/methodology
• Adopted only for very specific parts of very specific safety/security critical
software
©2018TrustInSoft
14
Conclusion
• Soundness of tools is a definitive improvement for security
• Do not try to reach the highest integrity levels instantly
• Stopping in the middle of any level is worth it
àone reduces its hidden technical debt
• Difference with unsound tools
àeach step is a definitive improvement for security
àWhen it is done, it is for real
©2018TrustInSoft
15
Thank you
Benjamin.Monate@trust-in-soft.com

More Related Content

What's hot

Shift Left Security
Shift Left SecurityShift Left Security
Shift Left Security
gjdevos
 
DevSecOps Beginners Guide : How to secure process in DevOps with OpenSource
DevSecOps Beginners Guide : How to secure process in DevOps with OpenSourceDevSecOps Beginners Guide : How to secure process in DevOps with OpenSource
DevSecOps Beginners Guide : How to secure process in DevOps with OpenSource
DevOps Indonesia
 
Integrating security into Continuous Delivery
Integrating security into Continuous DeliveryIntegrating security into Continuous Delivery
Integrating security into Continuous Delivery
Tom Stiehm
 
Flight East 2018 Presentation–Continuous Integration––An Overview
Flight East 2018 Presentation–Continuous Integration––An OverviewFlight East 2018 Presentation–Continuous Integration––An Overview
Flight East 2018 Presentation–Continuous Integration––An Overview
Synopsys Software Integrity Group
 
Securing the continuous integration
Securing the continuous integrationSecuring the continuous integration
Securing the continuous integration
Irene Michlin
 
Introducing: Klocwork Insight Pro | November 2009
Introducing: Klocwork Insight Pro | November 2009Introducing: Klocwork Insight Pro | November 2009
Introducing: Klocwork Insight Pro | November 2009
Klocwork
 
Application Security from the Inside Out
Application Security from the Inside OutApplication Security from the Inside Out
Application Security from the Inside Out
Ulisses Albuquerque
 
Flight East 2018 Presentation–Black Duck at Docusign
Flight East 2018 Presentation–Black Duck at DocusignFlight East 2018 Presentation–Black Duck at Docusign
Flight East 2018 Presentation–Black Duck at Docusign
Synopsys Software Integrity Group
 
Shifting the conversation from active interception to proactive neutralization
Shifting the conversation from active interception to proactive neutralization Shifting the conversation from active interception to proactive neutralization
Shifting the conversation from active interception to proactive neutralization
Rogue Wave Software
 
Static Analysis Techniques For Testing Application Security - Houston Tech Fest
Static Analysis Techniques For Testing Application Security - Houston Tech FestStatic Analysis Techniques For Testing Application Security - Houston Tech Fest
Static Analysis Techniques For Testing Application Security - Houston Tech Fest
Denim Group
 
Perforce on Tour 2015 - Grab Testing By the Horns and Move
Perforce on Tour 2015 - Grab Testing By the Horns and MovePerforce on Tour 2015 - Grab Testing By the Horns and Move
Perforce on Tour 2015 - Grab Testing By the Horns and Move
Perforce
 
Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?
Source Conference
 
Speeding Up Secure Software Development
Speeding Up Secure Software DevelopmentSpeeding Up Secure Software Development
Speeding Up Secure Software Development
Ulisses Albuquerque
 
Devops security-An Insight into Secure-SDLC
Devops security-An Insight into Secure-SDLCDevops security-An Insight into Secure-SDLC
Devops security-An Insight into Secure-SDLC
Suman Sourav
 
How to Manage the Risk of your Polyglot Environments
How to Manage the Risk of your Polyglot EnvironmentsHow to Manage the Risk of your Polyglot Environments
How to Manage the Risk of your Polyglot Environments
DevOps.com
 
Integrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps EnvironmentIntegrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps Environment
Black Duck by Synopsys
 
Security Services and Approach by Nazar Tymoshyk
Security Services and Approach by Nazar TymoshykSecurity Services and Approach by Nazar Tymoshyk
Security Services and Approach by Nazar Tymoshyk
SoftServe
 
Static Code Analysis
Static Code AnalysisStatic Code Analysis
Static Code Analysis
Obika Gellineau
 
Automating Your Tools: How to Free Up Your Security Professionals for Actual ...
Automating Your Tools: How to Free Up Your Security Professionals for Actual ...Automating Your Tools: How to Free Up Your Security Professionals for Actual ...
Automating Your Tools: How to Free Up Your Security Professionals for Actual ...
Kevin Fealey
 
A Successful SAST Tool Implementation
A Successful SAST Tool ImplementationA Successful SAST Tool Implementation
A Successful SAST Tool Implementation
Checkmarx
 

What's hot (20)

Shift Left Security
Shift Left SecurityShift Left Security
Shift Left Security
 
DevSecOps Beginners Guide : How to secure process in DevOps with OpenSource
DevSecOps Beginners Guide : How to secure process in DevOps with OpenSourceDevSecOps Beginners Guide : How to secure process in DevOps with OpenSource
DevSecOps Beginners Guide : How to secure process in DevOps with OpenSource
 
Integrating security into Continuous Delivery
Integrating security into Continuous DeliveryIntegrating security into Continuous Delivery
Integrating security into Continuous Delivery
 
Flight East 2018 Presentation–Continuous Integration––An Overview
Flight East 2018 Presentation–Continuous Integration––An OverviewFlight East 2018 Presentation–Continuous Integration––An Overview
Flight East 2018 Presentation–Continuous Integration––An Overview
 
Securing the continuous integration
Securing the continuous integrationSecuring the continuous integration
Securing the continuous integration
 
Introducing: Klocwork Insight Pro | November 2009
Introducing: Klocwork Insight Pro | November 2009Introducing: Klocwork Insight Pro | November 2009
Introducing: Klocwork Insight Pro | November 2009
 
Application Security from the Inside Out
Application Security from the Inside OutApplication Security from the Inside Out
Application Security from the Inside Out
 
Flight East 2018 Presentation–Black Duck at Docusign
Flight East 2018 Presentation–Black Duck at DocusignFlight East 2018 Presentation–Black Duck at Docusign
Flight East 2018 Presentation–Black Duck at Docusign
 
Shifting the conversation from active interception to proactive neutralization
Shifting the conversation from active interception to proactive neutralization Shifting the conversation from active interception to proactive neutralization
Shifting the conversation from active interception to proactive neutralization
 
Static Analysis Techniques For Testing Application Security - Houston Tech Fest
Static Analysis Techniques For Testing Application Security - Houston Tech FestStatic Analysis Techniques For Testing Application Security - Houston Tech Fest
Static Analysis Techniques For Testing Application Security - Houston Tech Fest
 
Perforce on Tour 2015 - Grab Testing By the Horns and Move
Perforce on Tour 2015 - Grab Testing By the Horns and MovePerforce on Tour 2015 - Grab Testing By the Horns and Move
Perforce on Tour 2015 - Grab Testing By the Horns and Move
 
Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?
 
Speeding Up Secure Software Development
Speeding Up Secure Software DevelopmentSpeeding Up Secure Software Development
Speeding Up Secure Software Development
 
Devops security-An Insight into Secure-SDLC
Devops security-An Insight into Secure-SDLCDevops security-An Insight into Secure-SDLC
Devops security-An Insight into Secure-SDLC
 
How to Manage the Risk of your Polyglot Environments
How to Manage the Risk of your Polyglot EnvironmentsHow to Manage the Risk of your Polyglot Environments
How to Manage the Risk of your Polyglot Environments
 
Integrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps EnvironmentIntegrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps Environment
 
Security Services and Approach by Nazar Tymoshyk
Security Services and Approach by Nazar TymoshykSecurity Services and Approach by Nazar Tymoshyk
Security Services and Approach by Nazar Tymoshyk
 
Static Code Analysis
Static Code AnalysisStatic Code Analysis
Static Code Analysis
 
Automating Your Tools: How to Free Up Your Security Professionals for Actual ...
Automating Your Tools: How to Free Up Your Security Professionals for Actual ...Automating Your Tools: How to Free Up Your Security Professionals for Actual ...
Automating Your Tools: How to Free Up Your Security Professionals for Actual ...
 
A Successful SAST Tool Implementation
A Successful SAST Tool ImplementationA Successful SAST Tool Implementation
A Successful SAST Tool Implementation
 

Similar to Applying formal methods to existing software by B.Monate

Agile Secure Development
Agile Secure DevelopmentAgile Secure Development
Agile Secure Development
Bosnia Agile
 
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
Mike Spaulding
 
Continuous security: Bringing agility to the secure development lifecycle
Continuous security: Bringing agility to the secure development lifecycleContinuous security: Bringing agility to the secure development lifecycle
Continuous security: Bringing agility to the secure development lifecycle
Rogue Wave Software
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically Guaranteed
Ashley Zupkus
 
Static Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and YouStatic Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and You
Kevin Fealey
 
Deepfence.pdf
Deepfence.pdfDeepfence.pdf
Deepfence.pdf
Vishwas N
 
TechTalk 2021: Peran IT Security dalam Penerapan DevOps
TechTalk 2021: Peran IT Security dalam Penerapan DevOpsTechTalk 2021: Peran IT Security dalam Penerapan DevOps
TechTalk 2021: Peran IT Security dalam Penerapan DevOps
DicodingEvent
 
Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...
Achim D. Brucker
 
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare ☁
 
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare ☁
 
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare ☁
 
Application security meetup k8_s security with zero trust_29072021
Application security meetup k8_s security with zero trust_29072021Application security meetup k8_s security with zero trust_29072021
Application security meetup k8_s security with zero trust_29072021
lior mazor
 
Protecting endpoints from targeted attacks
Protecting endpoints from targeted attacksProtecting endpoints from targeted attacks
Protecting endpoints from targeted attacks
AppSense
 
PCI and Vulnerability Assessments - What’s Missing?
PCI and Vulnerability Assessments - What’s Missing?PCI and Vulnerability Assessments - What’s Missing?
PCI and Vulnerability Assessments - What’s Missing?
Black Duck by Synopsys
 
AusCERT - Developing Secure iOS Applications
AusCERT - Developing Secure iOS ApplicationsAusCERT - Developing Secure iOS Applications
AusCERT - Developing Secure iOS Applications
eightbit
 
Endpoint Modeling 101 - A New Approach to Endpoint Security
Endpoint Modeling 101 - A New Approach to Endpoint SecurityEndpoint Modeling 101 - A New Approach to Endpoint Security
Endpoint Modeling 101 - A New Approach to Endpoint Security
Observable Networks
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSec
Lalit Kale
 
SCS DevSecOps Seminar - State of DevSecOps
SCS DevSecOps Seminar - State of DevSecOpsSCS DevSecOps Seminar - State of DevSecOps
SCS DevSecOps Seminar - State of DevSecOps
Stefan Streichsbier
 
Create code confidence for better application security
Create code confidence for better application securityCreate code confidence for better application security
Create code confidence for better application security
Rogue Wave Software
 
Reduce Third Party Developer Risks
Reduce Third Party Developer RisksReduce Third Party Developer Risks
Reduce Third Party Developer Risks
Kevo Meehan
 

Similar to Applying formal methods to existing software by B.Monate (20)

Agile Secure Development
Agile Secure DevelopmentAgile Secure Development
Agile Secure Development
 
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
 
Continuous security: Bringing agility to the secure development lifecycle
Continuous security: Bringing agility to the secure development lifecycleContinuous security: Bringing agility to the secure development lifecycle
Continuous security: Bringing agility to the secure development lifecycle
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically Guaranteed
 
Static Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and YouStatic Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and You
 
Deepfence.pdf
Deepfence.pdfDeepfence.pdf
Deepfence.pdf
 
TechTalk 2021: Peran IT Security dalam Penerapan DevOps
TechTalk 2021: Peran IT Security dalam Penerapan DevOpsTechTalk 2021: Peran IT Security dalam Penerapan DevOps
TechTalk 2021: Peran IT Security dalam Penerapan DevOps
 
Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...
 
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
 
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
 
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
Manoj Purandare - Application Security - Secure Code Assessment Program - Pre...
 
Application security meetup k8_s security with zero trust_29072021
Application security meetup k8_s security with zero trust_29072021Application security meetup k8_s security with zero trust_29072021
Application security meetup k8_s security with zero trust_29072021
 
Protecting endpoints from targeted attacks
Protecting endpoints from targeted attacksProtecting endpoints from targeted attacks
Protecting endpoints from targeted attacks
 
PCI and Vulnerability Assessments - What’s Missing?
PCI and Vulnerability Assessments - What’s Missing?PCI and Vulnerability Assessments - What’s Missing?
PCI and Vulnerability Assessments - What’s Missing?
 
AusCERT - Developing Secure iOS Applications
AusCERT - Developing Secure iOS ApplicationsAusCERT - Developing Secure iOS Applications
AusCERT - Developing Secure iOS Applications
 
Endpoint Modeling 101 - A New Approach to Endpoint Security
Endpoint Modeling 101 - A New Approach to Endpoint SecurityEndpoint Modeling 101 - A New Approach to Endpoint Security
Endpoint Modeling 101 - A New Approach to Endpoint Security
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSec
 
SCS DevSecOps Seminar - State of DevSecOps
SCS DevSecOps Seminar - State of DevSecOpsSCS DevSecOps Seminar - State of DevSecOps
SCS DevSecOps Seminar - State of DevSecOps
 
Create code confidence for better application security
Create code confidence for better application securityCreate code confidence for better application security
Create code confidence for better application security
 
Reduce Third Party Developer Risks
Reduce Third Party Developer RisksReduce Third Party Developer Risks
Reduce Third Party Developer Risks
 

Recently uploaded

Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 

Recently uploaded (20)

Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 

Applying formal methods to existing software by B.Monate

  • 1. ©2018TrustInSoft Benjamin Monate Co-founder of TrustInSoft and CTO Applying formal methods to existing software: what can you expect? 6/27/2018
  • 2. ©2018TrustInSoft 2 Sound Static Analysis aka formal methods to prove properties of software Works for Safety Critical Software • Consequences of failures are analyzed fromthe beginning • Regulation is strong: standards and associated liability • Adapted development process: specific languages/dev. cycles • Software errors mitigated with systemarchitecture àconsidering probability of failure
  • 3. ©2018TrustInSoft 3 Sound Static Analysisfor Security Critical Software? • Meanings of failure probability? àadversary defies standard distributions of the software input • One single error àarbitrary corruption • Confidentiality: secrets must not escape software • Software already deployed in production: barely tested for security - Because testing security is hard: looking for behaviors that have undefined consequences but are most of the time invisible - Observing a data leak is difficult: where shall it be observed? How shall one recognize that some bits are part of a secret?
  • 4. ©2018TrustInSoft 4 TrustInSoft pragmatic and incremental security Each level requires someprevious ones to bemeaningful TrustInSoft Analyzer addresses Level 2 up to Level 5 Confidence Level Property Tool Guaranteed properties Level 1 Each compilation unit compiles Compilers with warnings Statictypingand syntacticcompliance Level 2 Integrity of link Sound SourceLinker Consistency of compilationunits (ODR/static inline/weak) Level 3 Only defined behaviors Sound StaticAnalyzer Absenceof undefined behaviors/Integrity Compilers optimizations makes the consequences more and more dangerous Level 4 Dataflowintegrity Sound StaticAnalyzer Absenceof unwanted data flows/Confidentiality Level 5 Functional correctness Sound Functional Verification Programfulfills its functional specification
  • 5. ©2018TrustInSoft 5 Howto reach these levels on legacy code? • Level 1 for free • Level 2 automatic with TrustInSoft Analyzer: just provide all source files May be detected by modern binary-level LTO Reduced example fromXen file1.c: int GlobalConfig[255] = { 0 }; file2.c: extern int *Globalconfig; • Level 3 not easy to get because - Soundness: false alarms, not the most important problem - Programs contain bugs: must be fixed to give semantics
  • 6. ©2018TrustInSoft 6 Methodology toward Level 3 security Do not explore all execution paths at once, but • Explore simple path: rely on existing test-suite • Fix all discovered bugs - Unliketesting: detect invisibleundefined behaviors àInvisiblebut may hidesecurity bugs thanks to compiler optimization/platform specificities - No need to befully deterministic: external functions/hardwareare stubbed - Useanexistingtest to reach somedifficult-to-reach programpoints (after SSL certificatevalidation) and theninvent newtests by mutating the input data that do not changetheinitial paths (fuzzing, manual testing) - Generalizethetests progressively àfix bugs one after the other - Maybe one reaches a state where all behaviors are covered àBut if onedoes not, thesecurity is still vastly improved, step-by-step
  • 7. ©2018TrustInSoft 7 Howlong does it take to get a proof of absence of undefined behaviors? • Major industrial question: ROI, Time To Market, Total Cost of Ownership • Important but flawed question: - It takes the time that one needs to fix all the discovered bugs - No one knows howto evaluate this soundly • Cyber-security is incremental - Soundness does not mean: “all questions answered” - Soundness does mean: “some questions answered definitively” Not necessarily “the” whole question
  • 8. ©2018TrustInSoft 8 Examples: tooling funded for zero false positive and zero false negative source code analysis Hundreds of security bugs discovered: most of themfixed upstream • Initial analysis: existing test-suites • Further analysis: AFL fuzzing • Next steps: generalized input to reach more behaviors Invalid memory accesses, signed overflows, uninitialized data, double free, strict aliasing violations, constant execution time… OpenSSL, Amazon S2N, Google Libwebp, expat, libpng, SQLite, musl, libjpg, libsodium, LibreSSL, tiny ssh, libxml, zlib, ntpd, libbzip2, dpdk, nova, libksba
  • 9. ©2018TrustInSoft 9 Examples: subtle bug in Google’s libwebp • Invalid pointer computation: invisible UB • Followed by invalid pointer comparison - result depends on memory layout - If the result is wrong, out-of-bound access occurs • LLVMASan statistically uses the memory layout without consequences • TrustInSoft Analyzer’s soundness means: all memory layouts are explored
  • 10. ©2018TrustInSoft 10 Full Level 3 is reachable Proof of absence of UBs for some configurations of mbed TLS Read the full technical report at https: //trust-in-soft.com/polarssl-verification-kit/
  • 11. ©2018TrustInSoft 11 Good news for cyber-security • These examples are the most difficult software to analyze - Huge legacy, multi-purpose code bases - No developer was involved in the analysis: only bug reports - Time to convince developers/maintainers that fixing issues is important • And still: it works! Security is improved: fewer bugs and unmodified dev. process • In the industry, this is much simpler!
  • 12. ©2018TrustInSoft 12 Level 4 : Dataflowintegrity Example: look for the sources of randomnumbers in OpenSSL Explicit security property: Random generators seeds are acceptable - Customer knows what "acceptable" means - Tools can extract the origin of the data: sound means exhaustive Findings: a dozen of sources are used, including the private certificate Customer conclusion: we must configure the stack to avoid this Classical security analysis: define attack surfaces and implement proper mitigations This works onthesourcecode, if security expressed interms of programs behaviors
  • 13. ©2018TrustInSoft 13 Level 5: full specifications for all functions Kind of a Grail for programcorrectness • We support this usage • Impacts the dev. Cycle: - Produce specifications - Check specifications àsoftware developed to make it provable maybe with dedicated languages/methodology • Adopted only for very specific parts of very specific safety/security critical software
  • 14. ©2018TrustInSoft 14 Conclusion • Soundness of tools is a definitive improvement for security • Do not try to reach the highest integrity levels instantly • Stopping in the middle of any level is worth it àone reduces its hidden technical debt • Difference with unsound tools àeach step is a definitive improvement for security àWhen it is done, it is for real