Injection-Angriffe: Szenarien, Analyseanstze, Gegenmanahmen und - - PowerPoint PPT Presentation

injection angriffe szenarien analyseans tze gegenma
SMART_READER_LITE
LIVE PREVIEW

Injection-Angriffe: Szenarien, Analyseanstze, Gegenmanahmen und - - PowerPoint PPT Presentation

Injection-Angriffe: Szenarien, Analyseanstze, Gegenmanahmen und Erfahrungen aus der Praxis Dr. Alexander von Rhein Alexander von Rhein Research Software Verification Software-Product-Line Analysis Taint-Analysis Consulting Software


slide-1
SLIDE 1

Injection-Angriffe: Szenarien, Analyseansätze, Gegenmaßnahmen und Erfahrungen aus der Praxis

  • Dr. Alexander von Rhein
slide-2
SLIDE 2

Alexander von Rhein Research

  • Software Verification
  • Software-Product-Line Analysis
  • Taint-Analysis

Consulting

  • Software Development
  • Quality-Assessment & Quality-Controlling

Free for Research & Open Source Projects

slide-3
SLIDE 3

Security Threat: System Command Injection

rm -rf

source sink

slide-4
SLIDE 4

Most Common Security Threats in SAP Systems

  • Code execution
  • Cross-client access
  • Directory traversal
  • Database modification
  • Authentication flaws
  • Open SQL injection

Injection/leak attacks

slide-5
SLIDE 5

Security Situation in SAP systems

  • 83% Forbes 500 companies use SAP (mainly ERP systems)
  • Customization
  • SAP systems are extended with custom code written in ABAP
  • In-house, closed-world development

[Business Risk Illustration, Onapsis]

slide-6
SLIDE 6

Analysis View – Closed World System

  • Source (Report Parameter)
  • Sinks
  • System-Commands
  • CALL ‘SYSTEM‘ ID ‘COMMAND‘
  • Directory Traversal
  • OPEN DATASET
  • ABAP Program Generation
  • INSERT REPORT
  • GENERATE SUBROUTINE POOL
  • Loop iteration limits
  • DO input TIMES. … ENDDO.
  • … 21 pattern in total

source sink

slide-7
SLIDE 7

ABAP in 1 minute

Object, can be invoked by user Parameter of the report „Main method“ of the report Class declaration Class implementation

slide-8
SLIDE 8

Analysis View – Closed World System

  • Source (Report Parameter)
  • Sinks
  • System-Commands
  • CALL ‘SYSTEM‘ ID ‘COMMAND‘
  • Directory Traversal
  • OPEN DATASET
  • ABAP Program Generation
  • INSERT REPORT
  • GENERATE SUBROUTINE POOL
  • Loop iteration limits
  • DO input TIMES. … ENDDO.
  • … 21 pattern in total

source sink

slide-9
SLIDE 9

Simple Security Threat Scenario

SAP ERP Database

Data Injection Data Leak

slide-10
SLIDE 10

Trivial Checks for Deprecated Sinks

  • Local analysis (typically method level)
  • Fast
  • Here: Based on discouraged statements
slide-11
SLIDE 11

Taint-Propagation Analysis

  • Detailed taint-propagation analysis
  • Requires much more time and memory
  • Data-flow analysis
  • Tracks user input

to unsecure statements

y = 1, z = 2 x z = x + y z

1 2 3

y x z  

source sink source sink

slide-12
SLIDE 12

Global inter-procedural taint-propagation analysis

  • Complex data flow
  • Crossing method boudaries
  • Multiple files
  • Large, active code bases
  • Incremental analysis

1 2 3 4 5

sink source

slide-13
SLIDE 13

1659 LOC / 1301 SLOC

slide-14
SLIDE 14

Findings im Benchmark

  • Trivial Checks
  • 12.943 yellow findings
  • 24.555 red findings
  • Taint Analysis
  • 7.251 taint-analysis findings
  • Some methods (2%) had to be ignored (cycles, complexity)
slide-15
SLIDE 15

Performance

  • Performance benchmark
  • 12.600.000 source lines of code from customers
  • Some projects use git, so they have actually more code
  • with 270.000 methods
  • 3 hours initial analysis time
  • Analysis time for single commit depends on number of „touched“ methods
  • Typically few seconds
slide-16
SLIDE 16
slide-17
SLIDE 17

Beyond ABAP

  • ABAP
  • Closed world
  • Client/Server setting
  • Database and Server-Filesystem are typically trusted
  • Entropy of identifiers (method names, variable names) is high
  • Java, C#, …
  • No closed-world scenario
  • Who defines the taint sources and sinks?
  • More use of high-level programming (inheritance, lambdas, …)
  • Many similar variable and method names
slide-18
SLIDE 18

Code Code … and many more. Version History Models Static Analysis Test Coverage Reviews Issues Test Results Models Version History Static Analysis Test Coverage

GCOV

Reviews Test Results

cmocka

Issue Trackers

slide-19
SLIDE 19

Models Software Intelligence Code

Version History Static Analysis Test Coverage

Reviews Issues Test Results

slide-20
SLIDE 20

Does our system leak confidential data? Where are gaps in my tests?

Models Software Intelligence Code

Version History Static Analysis

Test

Coverage

Reviews Issues Test Results

slide-21
SLIDE 21

GUI.Base GUI.Dialogs Authentication UI Controls Data Validation

slide-22
SLIDE 22
  • = Modified & untested
  • = Added & untested
  • = Unchanged
slide-23
SLIDE 23

Does our system leak confidential data? Where are gaps in my tests? Which code is actually used?

Models Software Intelligence Code

Version History Static Analysis

Test

Coverage

Reviews Issues Test Results

slide-24
SLIDE 24
slide-25
SLIDE 25

Does our system leak confidential data? Where are gaps in my tests? Which code is actually used? Are there head- monopolies?

Models Software Intelligence Code

Version History Static Analysis

Test

Coverage

Reviews Issues Test Results

slide-26
SLIDE 26

Einarbeitung abgebrochen Neues Team Knowledge-Transfer

slide-27
SLIDE 27

Which changes have not been reviewed? Is our architecture in conformance with the code? Does our system leak confidential data? Where are gaps in my tests? Which code is actually used? Are there head- monopolies? Which components are most error-prone? Do we discover errors early enough?

Models Software Intelligence Code

Version History Static Analysis

Test

Coverage

Reviews Issues Test Results

slide-28
SLIDE 28

www.cqse.eu/de/ressourcen/blog/

slide-29
SLIDE 29

Conclusion Static analysis can find many attack scenarios at development time. Security attacks are often injection/leak attacks. (Near) real-time feedback is vital for acceptance. Our solution is incremental analysis. Wanted: Evaluation partners for security analyses (and teamscale in general).

slide-30
SLIDE 30

Kontakt

  • Dr. Alexander von Rhein · rhein@cqse.eu · +49 159 04517754

@alexvonrhein www.cqse.eu/en/blog CQSE GmbH Centa-Hafenbrädl-Straße 59 81249 München