Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL injection in bigtreecms 4.2.18 #304

Closed
songtancat opened this issue Jul 29, 2017 · 1 comment
Closed

SQL injection in bigtreecms 4.2.18 #304

songtancat opened this issue Jul 29, 2017 · 1 comment
Milestone

Comments

@songtancat
Copy link

SQL injection in bigtreecms 4.2.18

Needs an account of normal user with edit module permissions.

in BigTree\core\admin\auto-modules\forms\process.php:

get tags parameter:
$tags = $_POST["_tags"];

call updateItem() or createItem() with tags:
BigTreeAutoModule::updateItem($table,$edit_id,$item,$many_to_many,$tags);

in updateItem() or createItem():

foreach ($tags as $tag) {
    sqlquery("DELETE FROM bigtree_tags_rel WHERE 'table' = '".sqlescape($table)."' AND entry = $id AND tag = $tag"); 
    sqlquery("INSERT INTO bigtree_tags_rel ('table','entry','tag') VALUES ('".sqlescape($table)."',$id,$tag)");
}

call sqlquery() without sqlescape() the tag parameter. cause sql injection

to exploit:

  1. login with edit module permissions.
  2. get the post request of edit module.
POST /BigTree/site/index.php/admin/trees/edit/process/ HTTP/1.1
...
...
Content-Disposition: form-data; name="_tags[0]"

123*
...
...
  1. send it to sqlmap tool
    image
@timbuckingham
Copy link
Collaborator

Thanks! This should be fixed in the upcoming 4.2.19 release next week.

@timbuckingham timbuckingham added this to the 4.2.19 milestone Jul 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants