Skip to content

Commit

Permalink
fix(security): sql injection in "Social & Donations" module
Browse files Browse the repository at this point in the history
  • Loading branch information
eteubert committed Aug 22, 2021
1 parent f53ddbe commit aa8a343
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/modules/social/model/contributor_service.php
Expand Up @@ -51,6 +51,9 @@ public function get_service_url()

public static function find_by_contributor_id_and_category($contributor_id, $category = 'social')
{
$contributor_id = (int) $contributor_id;
$category = $category == 'social' ? 'social' : 'donation';

return self::all('WHERE service_id IN (SELECT id FROM '.Service::table_name()." WHERE `category` = '".$category."' ) AND `contributor_id` = ".$contributor_id);
}
}
Expand Down
2 changes: 2 additions & 0 deletions lib/modules/social/model/show_service.php
Expand Up @@ -32,6 +32,8 @@ public function get_service_url()

public static function find_by_category($category = 'social')
{
$category = $category == 'social' ? 'social' : 'donation';

return self::all('WHERE service_id IN (SELECT id FROM '.Service::table_name()." WHERE `category` = '".$category."' ) ORDER BY position ASC");
}
}
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Expand Up @@ -106,6 +106,10 @@ This product includes GeoLite2 data created by MaxMind, available from http://ww

== Changelog ==

= 2021-08-22 =

* fix(security): sql injection in "Social & Donations" module

= 2021-05-02 =

* fix: transcript API returns list again
Expand Down

0 comments on commit aa8a343

Please sign in to comment.