SlideShare a Scribd company logo
1 of 26
Download to read offline
Xu Jia, Andreas Wiegenstein
I know what you coded last summer
An analysis of 450 million lines of custom ABAP code
Troopers15 Conference (SAP Security Track) March 18, 2015
Exclusively made for
Agenda
1. SAP standard und custom development
2. Custom code statistics
3. Best Practices
2
#SAP
#Security
#Research
CTO at Virtual Forge
SAP Security Researcher, active since 2003
Received credit from SAP for > 75 reported 0-day vulnerabilities
Various Publications, including DSAG and BSI
Speaker at international Conferences
Troopers, BlackHat, DeepSec, Hack in the Box, IT Defense, RSA,
DSAG, SAP TechEd
Andreas Wiegenstein
Xu Jia
Security Analyst at Virtual Forge
SAP Security Researcher, active since 2006
Received credit from SAP for > 30 reported 0-day vulnerabilities
Speaker at international Conferences
Troopers (2013,2014,2015), Sicherheit und Prüfung von SAP Systemen (2012)
SAP
4
Why protect SAP systems?
 More than 248,500 companies run SAP
 SAP customers …
 Transport > 1.1 billion flight passengers per year
 Produce > 65% of all TV’s
 Produce > 77,000 cars every day
 Produce > 52% of all movies
 … and …
 72% of the world-wide beer production depends on companies that run SAP !!!
SAP Custom Code - basics
(All) Customers change/enhance the SAP standard
 Internal development teams
 External development teams
The development guidelines of most customers focus on
 Naming conventions
The SAP standard delivers
 Rudimentary tools for static and dynamic code analysis
 No metrics regarding volume (Lines of Code)
5
SAP specifics
 SAP systems run independent of operating system and database
 SAP ships a proprietary front end: SAP GUI
 Access to business data requires specific regulations
 Authorization checks
 Maintaining change documents
 Data of different organizations (“Clients”) is stored (separately) in the same database schema
 Special ABAP command to execute authorization checks: AUTHORITY-CHECK
 Proprietary SQL layer between ABAP and the database: Open SQL
 Proprietary system-to-system communication: RFC (Remote Function Call)
6
What is the biggest risk with SAP systems?
Downtime
7
#Statistics
"There are three kinds of lies: lies, damned lies, and statistics."
(Benjamin Disraeli)
“Don’t trust statistics you didn’t falsify yourself.”
(Unknown)
Business Code Quality Benchmark
Ongoing project analyzing the entire ABAP code of one selected SAP system per company
 Results from 217 companies so far
 With diverse quality assurance processes / maturity
 Various (corporate) size
 With a SAP history of different length
 From various industry sectors and countries
 Based on static code analysis
 Performance, Rosbustness, Security, Compliance
 Only “critical” mistakes are considered in the statistics
 Data collection done in 2013 and 2014
9
Business Code
Quality Benchmark
Statistics - General
Companies have on average 2.08 million lines of custom code per SAP system
 Companies don’t run “pure” SAP standard solutions
The most common code module types are FORMs (procedures) with 64%, followed by methods (19%)
 Most custom code is therefore difficult to reuse
There are on average 14,500 additional input sources due to custom code per system
 Each input / data source increases the attack surface of a software
78% of all user input comes via SAP GUI applications
18% of all user input comes via RFC (Remote Function Call) communication
 Malicious insiders therefore have the highest chance to find SAP vulnerabilities
11
Statistics – General (2)
There are more quality issues with database access than there is database access
 There are on average 24,635 Open SQL queries in custom code
( 21,227 read accesses und 3,408 write accesses )
 There are on average 26,147 quality issues with Open SQL queries
( distributed across all test areas )
Only 0.3% of all SAP modules are (directly) accessible via HTTP / Internet
 Security solutions like Web Application Firewalls have limited value in SAP installations
12
Statistics – Security and Compliance
There is 1 critical security / compliance issue per 1,000 lines of code
 A typical SAP system has therefore 2,151 security / compliance issues in custom code alone.
List of the 5 most common types of security and compliance issues:
* Probability indicates in how many analyzed systems at least one issue of this type was found
** Occurrences reflect the absolute number of critical flaws detected per system on average.
13
Type of vulnerability Probability * Occurrences **
Authorization Flaw 100 % 1.056
Directory Traversal 91 % 308
Direct Database Modification 86 % 39
Cross-Client Access 83 % 122
Open SQL Injection 70 % 15
Statistics – Security and Compliance (2)
Out of the pool of critical issues, there are on average 10 vulnerabilities per system that are so grave
that a single exploit will result in total system compromise.
There are on average 184 proprietary authorization checks based on sy-uname per system. The
probability to encounter at least one proprietary authorization check is 91%.
 „Red traffic light“ in financial audits
There are 476 RFC-enabled function modules per system. 64% of them are completely lacking
authority checks.
14
DEMO
Statistics – Security and Compliance (3)
15
#Best Practices
"A best practice is a method or technique that has consistently shown results
superior to those achieved with other means, and that is used as a benchmark.
In addition, a "best" practice can evolve to become better as improvements are
discovered."
en.wikipedia.org
Best Practices
Conduct an awareness workshop for your management
 Without a binding process with management backup nothing will change
Set achievable goals
 No developer will learn 100 new secure coding practices over night
Device a plan how to deal with legacy code
 Corrections need time
 It’s economically unviable to correct all issues
17
Best Practices (2)
Issue meaningful development guidelines
 For all relevant quality areas
 For internal and external development
Caution: Application security is difficult to understand for most developers
 Regular trainings are required in order to establish a sound security understanding
Leverage tools in order to check for compliance with your development guidelines
 You can only realise testable requirements
 Only tools will provide transparency where your company stands with regards to SAP code quality
Measure the success of your activities
 Success is the basis for long-term acceptance of a new process
18
Output
The Business Code Quality Benchmark (BCQB) by Virtual Forge is the first of its kind.
The results were used to provide guidance to companies depending on ABAP code:
 The BIZEC “APP/11” standard for ABAP security flaws is based on BCQB
 The BSI “ABAP Top 20 Security Risks” are based on the BCQB
19
BIZEC APP/11
BSI „ABAP Top 20“
Conclusion
22
If your company runs SAP, it has (statistically spoken) significant quality issues in custom code.
Your company is exposed to the following risks
 System downtime
 “Red lights” in financial / compliance audits
 Industrial Espionage
 Business data manipulation
 Backdoors
Next week
Take part in our study: Business Code Quality Benchmark
Receive a comprehensive report for one of your SAP systems
Next month
Discuss the results with your management
Optimize your development process
Next year
Run you custom SAP applications more secure
Next Steps
23
#ThingsWeFoundWhenPentestingSAP
Thank you for your attention.
Questions ?
@codeprofiler @xubcode
Now or
later
Disclaimer
25
© 2015 Virtual Forge GmbH. All rights reserved.
Information contained in this publication is subject to change without prior notice.
These materials are provided by Virtual Forge and serve only as information.
SAP, ABAP and other named SAP products and services as well as their respective logos are trademarks or
registered trademarks of SAP SE in Germany and other countries worldwide.
All other names of products and services are trademarks of their respective companies.
Virtual Forge accepts no liability or responsibility for errors or omissions in this publication. From the
information contained in this publication, no further liability is assumed. No part of this publication may be
reproduced or transmitted in any form or for any purpose without the express permission of Virtual Forge
GmbH, Germany or Virtual Forge Inc., Philadelphia. The General Terms and Conditions of Virtual Forge apply.
I know what you coded last summer (Troopers15 Conference - SAP Security Track)

More Related Content

More from Virtual Forge

Develop Stable, High-Performance Applications for SAP HANA
Develop Stable, High-Performance Applications for SAP HANADevelop Stable, High-Performance Applications for SAP HANA
Develop Stable, High-Performance Applications for SAP HANAVirtual Forge
 
Application Security Management with ThreadFix
Application Security Management with ThreadFixApplication Security Management with ThreadFix
Application Security Management with ThreadFixVirtual Forge
 
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP InstallationenABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP InstallationenVirtual Forge
 
Is your SAP system vulnerable to cyber attacks?
Is your SAP system vulnerable to cyber attacks?Is your SAP system vulnerable to cyber attacks?
Is your SAP system vulnerable to cyber attacks?Virtual Forge
 
How to assess the risks in your SAP systems at the push of a button
How to assess the risks in your SAP systems at the push of a buttonHow to assess the risks in your SAP systems at the push of a button
How to assess the risks in your SAP systems at the push of a buttonVirtual Forge
 
Case Study: Ensuring the Quality and Security of Custom SAP Applications at t...
Case Study: Ensuring the Quality and Security of Custom SAP Applications at t...Case Study: Ensuring the Quality and Security of Custom SAP Applications at t...
Case Study: Ensuring the Quality and Security of Custom SAP Applications at t...Virtual Forge
 
Uninvited Guests: Why do hackers love our SAP landscapes?
Uninvited Guests: Why do hackers love our SAP landscapes?Uninvited Guests: Why do hackers love our SAP landscapes?
Uninvited Guests: Why do hackers love our SAP landscapes?Virtual Forge
 
Ungebetene Gäste: Warum lieben Hacker aus aller Welt unsere SAP Landschaften?
Ungebetene Gäste: Warum lieben Hacker aus aller Welt unsere SAP Landschaften?Ungebetene Gäste: Warum lieben Hacker aus aller Welt unsere SAP Landschaften?
Ungebetene Gäste: Warum lieben Hacker aus aller Welt unsere SAP Landschaften?Virtual Forge
 
Case Study: Automated Code Reviews In A Grown SAP Application Landscape At EW...
Case Study: Automated Code Reviews In A Grown SAP Application Landscape At EW...Case Study: Automated Code Reviews In A Grown SAP Application Landscape At EW...
Case Study: Automated Code Reviews In A Grown SAP Application Landscape At EW...Virtual Forge
 
Case Study: Automatisierte Code Reviews in einer gewachsenen SAP-Applikations...
Case Study: Automatisierte Code Reviews in einer gewachsenen SAP-Applikations...Case Study: Automatisierte Code Reviews in einer gewachsenen SAP-Applikations...
Case Study: Automatisierte Code Reviews in einer gewachsenen SAP-Applikations...Virtual Forge
 
10 GOLDEN RULES FOR CODING AUTHORIZATION CHECKS IN ABAP
10 GOLDEN RULES FOR CODING AUTHORIZATION CHECKS IN ABAP10 GOLDEN RULES FOR CODING AUTHORIZATION CHECKS IN ABAP
10 GOLDEN RULES FOR CODING AUTHORIZATION CHECKS IN ABAPVirtual Forge
 
Risks of Hosted SAP Environments
Risks of Hosted SAP EnvironmentsRisks of Hosted SAP Environments
Risks of Hosted SAP EnvironmentsVirtual Forge
 
Case Study: ABAP Development Life Cycle and Governance at THE GLOBE AND MAIL ...
Case Study: ABAP Development Life Cycle and Governance at THE GLOBE AND MAIL ...Case Study: ABAP Development Life Cycle and Governance at THE GLOBE AND MAIL ...
Case Study: ABAP Development Life Cycle and Governance at THE GLOBE AND MAIL ...Virtual Forge
 
Die Top 5 Mythen der SAP Sicherheit
Die Top 5 Mythen der SAP SicherheitDie Top 5 Mythen der SAP Sicherheit
Die Top 5 Mythen der SAP SicherheitVirtual Forge
 
Mobile Trends And The New Threats - Is Your SAP System Vulnerable to Cyber At...
Mobile Trends And The New Threats - Is Your SAP System Vulnerable to Cyber At...Mobile Trends And The New Threats - Is Your SAP System Vulnerable to Cyber At...
Mobile Trends And The New Threats - Is Your SAP System Vulnerable to Cyber At...Virtual Forge
 
ABAP Code Qualität - Best Practices
ABAP Code Qualität - Best PracticesABAP Code Qualität - Best Practices
ABAP Code Qualität - Best PracticesVirtual Forge
 
Best Practices for Ensuring SAP ABAP Code Quality and Security
Best Practices for Ensuring SAP ABAP Code Quality and SecurityBest Practices for Ensuring SAP ABAP Code Quality and Security
Best Practices for Ensuring SAP ABAP Code Quality and SecurityVirtual Forge
 
Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...
Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...
Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...Virtual Forge
 

More from Virtual Forge (18)

Develop Stable, High-Performance Applications for SAP HANA
Develop Stable, High-Performance Applications for SAP HANADevelop Stable, High-Performance Applications for SAP HANA
Develop Stable, High-Performance Applications for SAP HANA
 
Application Security Management with ThreadFix
Application Security Management with ThreadFixApplication Security Management with ThreadFix
Application Security Management with ThreadFix
 
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP InstallationenABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
 
Is your SAP system vulnerable to cyber attacks?
Is your SAP system vulnerable to cyber attacks?Is your SAP system vulnerable to cyber attacks?
Is your SAP system vulnerable to cyber attacks?
 
How to assess the risks in your SAP systems at the push of a button
How to assess the risks in your SAP systems at the push of a buttonHow to assess the risks in your SAP systems at the push of a button
How to assess the risks in your SAP systems at the push of a button
 
Case Study: Ensuring the Quality and Security of Custom SAP Applications at t...
Case Study: Ensuring the Quality and Security of Custom SAP Applications at t...Case Study: Ensuring the Quality and Security of Custom SAP Applications at t...
Case Study: Ensuring the Quality and Security of Custom SAP Applications at t...
 
Uninvited Guests: Why do hackers love our SAP landscapes?
Uninvited Guests: Why do hackers love our SAP landscapes?Uninvited Guests: Why do hackers love our SAP landscapes?
Uninvited Guests: Why do hackers love our SAP landscapes?
 
Ungebetene Gäste: Warum lieben Hacker aus aller Welt unsere SAP Landschaften?
Ungebetene Gäste: Warum lieben Hacker aus aller Welt unsere SAP Landschaften?Ungebetene Gäste: Warum lieben Hacker aus aller Welt unsere SAP Landschaften?
Ungebetene Gäste: Warum lieben Hacker aus aller Welt unsere SAP Landschaften?
 
Case Study: Automated Code Reviews In A Grown SAP Application Landscape At EW...
Case Study: Automated Code Reviews In A Grown SAP Application Landscape At EW...Case Study: Automated Code Reviews In A Grown SAP Application Landscape At EW...
Case Study: Automated Code Reviews In A Grown SAP Application Landscape At EW...
 
Case Study: Automatisierte Code Reviews in einer gewachsenen SAP-Applikations...
Case Study: Automatisierte Code Reviews in einer gewachsenen SAP-Applikations...Case Study: Automatisierte Code Reviews in einer gewachsenen SAP-Applikations...
Case Study: Automatisierte Code Reviews in einer gewachsenen SAP-Applikations...
 
10 GOLDEN RULES FOR CODING AUTHORIZATION CHECKS IN ABAP
10 GOLDEN RULES FOR CODING AUTHORIZATION CHECKS IN ABAP10 GOLDEN RULES FOR CODING AUTHORIZATION CHECKS IN ABAP
10 GOLDEN RULES FOR CODING AUTHORIZATION CHECKS IN ABAP
 
Risks of Hosted SAP Environments
Risks of Hosted SAP EnvironmentsRisks of Hosted SAP Environments
Risks of Hosted SAP Environments
 
Case Study: ABAP Development Life Cycle and Governance at THE GLOBE AND MAIL ...
Case Study: ABAP Development Life Cycle and Governance at THE GLOBE AND MAIL ...Case Study: ABAP Development Life Cycle and Governance at THE GLOBE AND MAIL ...
Case Study: ABAP Development Life Cycle and Governance at THE GLOBE AND MAIL ...
 
Die Top 5 Mythen der SAP Sicherheit
Die Top 5 Mythen der SAP SicherheitDie Top 5 Mythen der SAP Sicherheit
Die Top 5 Mythen der SAP Sicherheit
 
Mobile Trends And The New Threats - Is Your SAP System Vulnerable to Cyber At...
Mobile Trends And The New Threats - Is Your SAP System Vulnerable to Cyber At...Mobile Trends And The New Threats - Is Your SAP System Vulnerable to Cyber At...
Mobile Trends And The New Threats - Is Your SAP System Vulnerable to Cyber At...
 
ABAP Code Qualität - Best Practices
ABAP Code Qualität - Best PracticesABAP Code Qualität - Best Practices
ABAP Code Qualität - Best Practices
 
Best Practices for Ensuring SAP ABAP Code Quality and Security
Best Practices for Ensuring SAP ABAP Code Quality and SecurityBest Practices for Ensuring SAP ABAP Code Quality and Security
Best Practices for Ensuring SAP ABAP Code Quality and Security
 
Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...
Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...
Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...
 

Recently uploaded

Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 

Recently uploaded (20)

Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 

I know what you coded last summer (Troopers15 Conference - SAP Security Track)

  • 1. Xu Jia, Andreas Wiegenstein I know what you coded last summer An analysis of 450 million lines of custom ABAP code Troopers15 Conference (SAP Security Track) March 18, 2015 Exclusively made for
  • 2. Agenda 1. SAP standard und custom development 2. Custom code statistics 3. Best Practices 2
  • 3. #SAP #Security #Research CTO at Virtual Forge SAP Security Researcher, active since 2003 Received credit from SAP for > 75 reported 0-day vulnerabilities Various Publications, including DSAG and BSI Speaker at international Conferences Troopers, BlackHat, DeepSec, Hack in the Box, IT Defense, RSA, DSAG, SAP TechEd Andreas Wiegenstein Xu Jia Security Analyst at Virtual Forge SAP Security Researcher, active since 2006 Received credit from SAP for > 30 reported 0-day vulnerabilities Speaker at international Conferences Troopers (2013,2014,2015), Sicherheit und Prüfung von SAP Systemen (2012)
  • 4. SAP 4 Why protect SAP systems?  More than 248,500 companies run SAP  SAP customers …  Transport > 1.1 billion flight passengers per year  Produce > 65% of all TV’s  Produce > 77,000 cars every day  Produce > 52% of all movies  … and …  72% of the world-wide beer production depends on companies that run SAP !!!
  • 5. SAP Custom Code - basics (All) Customers change/enhance the SAP standard  Internal development teams  External development teams The development guidelines of most customers focus on  Naming conventions The SAP standard delivers  Rudimentary tools for static and dynamic code analysis  No metrics regarding volume (Lines of Code) 5
  • 6. SAP specifics  SAP systems run independent of operating system and database  SAP ships a proprietary front end: SAP GUI  Access to business data requires specific regulations  Authorization checks  Maintaining change documents  Data of different organizations (“Clients”) is stored (separately) in the same database schema  Special ABAP command to execute authorization checks: AUTHORITY-CHECK  Proprietary SQL layer between ABAP and the database: Open SQL  Proprietary system-to-system communication: RFC (Remote Function Call) 6
  • 7. What is the biggest risk with SAP systems? Downtime 7
  • 8. #Statistics "There are three kinds of lies: lies, damned lies, and statistics." (Benjamin Disraeli) “Don’t trust statistics you didn’t falsify yourself.” (Unknown)
  • 9. Business Code Quality Benchmark Ongoing project analyzing the entire ABAP code of one selected SAP system per company  Results from 217 companies so far  With diverse quality assurance processes / maturity  Various (corporate) size  With a SAP history of different length  From various industry sectors and countries  Based on static code analysis  Performance, Rosbustness, Security, Compliance  Only “critical” mistakes are considered in the statistics  Data collection done in 2013 and 2014 9
  • 11. Statistics - General Companies have on average 2.08 million lines of custom code per SAP system  Companies don’t run “pure” SAP standard solutions The most common code module types are FORMs (procedures) with 64%, followed by methods (19%)  Most custom code is therefore difficult to reuse There are on average 14,500 additional input sources due to custom code per system  Each input / data source increases the attack surface of a software 78% of all user input comes via SAP GUI applications 18% of all user input comes via RFC (Remote Function Call) communication  Malicious insiders therefore have the highest chance to find SAP vulnerabilities 11
  • 12. Statistics – General (2) There are more quality issues with database access than there is database access  There are on average 24,635 Open SQL queries in custom code ( 21,227 read accesses und 3,408 write accesses )  There are on average 26,147 quality issues with Open SQL queries ( distributed across all test areas ) Only 0.3% of all SAP modules are (directly) accessible via HTTP / Internet  Security solutions like Web Application Firewalls have limited value in SAP installations 12
  • 13. Statistics – Security and Compliance There is 1 critical security / compliance issue per 1,000 lines of code  A typical SAP system has therefore 2,151 security / compliance issues in custom code alone. List of the 5 most common types of security and compliance issues: * Probability indicates in how many analyzed systems at least one issue of this type was found ** Occurrences reflect the absolute number of critical flaws detected per system on average. 13 Type of vulnerability Probability * Occurrences ** Authorization Flaw 100 % 1.056 Directory Traversal 91 % 308 Direct Database Modification 86 % 39 Cross-Client Access 83 % 122 Open SQL Injection 70 % 15
  • 14. Statistics – Security and Compliance (2) Out of the pool of critical issues, there are on average 10 vulnerabilities per system that are so grave that a single exploit will result in total system compromise. There are on average 184 proprietary authorization checks based on sy-uname per system. The probability to encounter at least one proprietary authorization check is 91%.  „Red traffic light“ in financial audits There are 476 RFC-enabled function modules per system. 64% of them are completely lacking authority checks. 14 DEMO
  • 15. Statistics – Security and Compliance (3) 15
  • 16. #Best Practices "A best practice is a method or technique that has consistently shown results superior to those achieved with other means, and that is used as a benchmark. In addition, a "best" practice can evolve to become better as improvements are discovered." en.wikipedia.org
  • 17. Best Practices Conduct an awareness workshop for your management  Without a binding process with management backup nothing will change Set achievable goals  No developer will learn 100 new secure coding practices over night Device a plan how to deal with legacy code  Corrections need time  It’s economically unviable to correct all issues 17
  • 18. Best Practices (2) Issue meaningful development guidelines  For all relevant quality areas  For internal and external development Caution: Application security is difficult to understand for most developers  Regular trainings are required in order to establish a sound security understanding Leverage tools in order to check for compliance with your development guidelines  You can only realise testable requirements  Only tools will provide transparency where your company stands with regards to SAP code quality Measure the success of your activities  Success is the basis for long-term acceptance of a new process 18
  • 19. Output The Business Code Quality Benchmark (BCQB) by Virtual Forge is the first of its kind. The results were used to provide guidance to companies depending on ABAP code:  The BIZEC “APP/11” standard for ABAP security flaws is based on BCQB  The BSI “ABAP Top 20 Security Risks” are based on the BCQB 19
  • 22. Conclusion 22 If your company runs SAP, it has (statistically spoken) significant quality issues in custom code. Your company is exposed to the following risks  System downtime  “Red lights” in financial / compliance audits  Industrial Espionage  Business data manipulation  Backdoors
  • 23. Next week Take part in our study: Business Code Quality Benchmark Receive a comprehensive report for one of your SAP systems Next month Discuss the results with your management Optimize your development process Next year Run you custom SAP applications more secure Next Steps 23
  • 24. #ThingsWeFoundWhenPentestingSAP Thank you for your attention. Questions ? @codeprofiler @xubcode Now or later
  • 25. Disclaimer 25 © 2015 Virtual Forge GmbH. All rights reserved. Information contained in this publication is subject to change without prior notice. These materials are provided by Virtual Forge and serve only as information. SAP, ABAP and other named SAP products and services as well as their respective logos are trademarks or registered trademarks of SAP SE in Germany and other countries worldwide. All other names of products and services are trademarks of their respective companies. Virtual Forge accepts no liability or responsibility for errors or omissions in this publication. From the information contained in this publication, no further liability is assumed. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of Virtual Forge GmbH, Germany or Virtual Forge Inc., Philadelphia. The General Terms and Conditions of Virtual Forge apply.