A few security issues
to takeover 34% of all websites
Johannes Dahse, PHP.RUHR 2019 Dortmund, Germany, 08.11.2019
1
A few security issues to takeover 34% of all websites Johannes - - PowerPoint PPT Presentation
A few security issues to takeover 34% of all websites Johannes Dahse, PHP.RUHR 2019 Dortmund, Germany, 08.11.2019 1 Intro Johannes Dahse Former CTF addict Security Consultant RIPS open source, static analysis for PHP security Ph.D. Static
Johannes Dahse, PHP.RUHR 2019 Dortmund, Germany, 08.11.2019
1
2
Johannes Dahse Former CTF addict Security Consultant RIPS open source, static analysis for PHP security Ph.D. Static Code Analysis @ Ruhr-University Bochum Co-Founder RIPS Technologies GmbH (since 2016)
3
4
500 KLOC PHP (+55.000 plugins) WordPress is used by 34.5% of the top 1M websites WordPress has a CMS market share of 61.2% ~240M unique domains = ~80M WordPress sites ~40M hosted on wordpress.com whitehouse.gov, Bloomberg, NBC, CNN, BBC, NYTimes
RoR Python
Usage of content management systems, W3Techs
5
Pre-Auth Exploit authenticated functionality
6
7
Comment via CSRF is a feature for trackbacks and pingbacks, but most HTML tags and attributes are stripped
8
attacker.com
9
10
<a rel="rips" title='XSS " onmouseover=evilCode() id=" '>
11
<a rel="rips" title='XSS " onmouseover=evilCode() id=" '> <a rel="rips" title= "XSS " onmouseover=evilCode() id=" ' ">
12
Regular comment (filter_kses)
13
Regular comment (filter_kses)
mysuperblog.com
14
Regular comment (filter_kses) Admin comment via CSRF (filter_post_kses)
mysuperblog.com
<a rel="rips" title= "XSS " onmouseover=evilCode() id=" ' ">
15
Pre-Auth Exploit authenticated functionality
16
17
18
19
Video: https://blog.ripstech.com/2018/wordpress-file-delete-to-code-execution/
20
Pre-Auth Exploit authenticated functionality
21
_wp_attached_file
22
_wp_attached_file
23
_wp_page_template: Loads template file from /template/ dir No way to upload malicious template file
24
Look for file in uploads/ directory Or try to fetch file via HTTP
25
26
evil.jpg?/../../template/evil.jpg
27
28
include('templates/evil.jpg');
29
Video: https://blog.ripstech.com/2019/wordpress-image-remote-code-execution/
30
Imagick does not crop image exif meta data, GD does strip exif meta data when cropping
31
Pre-Auth Exploit authenticated functionality
32
33
Critical bugs in 16 most-used plugins 21 million total active installations 8x WooCommerce (4M active installs)
34
35
SVN WP Plugin
36
→ XSS worm can add a new user as committer to this plugin, who then infects the version again, and adds a backdoor to the plugin <script>worm()</script>
johannes@ripstech.com / @FluxReiners
37