Securing PHP - PowerPoint PPT Presentation

About This Presentation
Title:

Securing PHP

Description:

Securing PHP Survey of the solutions Stanislav Malyshev stas_at_zend.com Input filtering Unauthorized code (remote include) Unauthorized DB access (SQL Injection) Client ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 12
Provided by: ZendT
Category:
Tags: php | actions | securing | unsafe

less

Transcript and Presenter's Notes

Title: Securing PHP


1
Securing PHP
  • Survey of the solutions
  • Stanislav Malyshev
  • stas_at_zend.com

2
Most code is extremely buggy
Can we help?
3
Input filtering
  • Unauthorized code (remote include)
  • Unauthorized DB access (SQL Injection)
  • Client subversion (XSS, XSRF)

4
Lets protect all data
  • Magic quotes
  • ? a.php?data12 -gt data 1\2 can be
    inside quotes
  • Optional
  • No support for context

5
Lets restrict the user
  • Safe mode
  • ? Allow access only to own files
  • ? Allow only safe actions
  • ? No OS support
  • ? Too many modules not controlled
  • ? Too hard to find out all unsafe ones and not
    kill apps

6
Lets filter
  • var filter_input(INPUT_GET, 'var')
  • Standard filters for standard use-cases
  • No time machine
  • Voluntary

7
Lets watch the data
  • Data tainting
  • No unfiltered data in sensitive contexts
  • How do I know the filtering was right?
  • Complex implementation contexts
  • Performance

8
Static vs. Dynamic
  • Static
  • ? Can be as slow as it needs to
  • False positive OK
  • External engine
  • foo bar
  • foo-gtbar(baz)
  • eval(foo.bar)
  • Dynamic
  • Real code, real data
  • Can prevent attack
  • Need for speed
  • Engine modification
  • Breaks applications

9
Lets watch the data - II
  • CSSE
  • Track each character of data
  • Ensure the data is safely
  • Safety is context-dependant
  • Modification for all operations
  • Performance?

10
Lets watch the input learn
  • Runtime detection
  • ? No need to study application
  • No need to study context
  • Complex heuristics
  • Needs data collection

11
?
Write a Comment
User Comments (0)
About PowerShow.com