Skip to content

Commit

Permalink
Blind sql injection fixes (#3284)
Browse files Browse the repository at this point in the history
  • Loading branch information
jekkos committed Aug 26, 2021
1 parent b925155 commit b4c48e5
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 18 deletions.
27 changes: 27 additions & 0 deletions SECURITY.md
@@ -0,0 +1,27 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Security Policy](#security-policy)
- [Supported Versions](#supported-versions)
- [Reporting a Vulnerability](#reporting-a-vulnerability)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Security Policy

## Supported Versions

We release patches for security vulnerabilities. Which versions are eligible
receiving such patches depend on the CVSS v3.0 Rating:

| CVSS v3.0 | Supported Versions |
| --------- | -------------------------------------------------- |
| 7.3 | 3.5.5 |

## Reporting a Vulnerability

Please report (suspected) security vulnerabilities to
**[jekkos](mailto:jekkos@opensourcepos.org)**. You will receive a response from
us within 48 hours. If the issue is confirmed, we will release a patch as soon

This comment has been minimized.

Copy link
@jekkos

jekkos Aug 26, 2021

Author Member

I must admit this SLA to be quite ambitious, some backup would appreciated.

as possible depending on complexity but historically within a few days.
4 changes: 2 additions & 2 deletions application/controllers/Attributes.php
Expand Up @@ -24,7 +24,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? definition.definition_name : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$attributes = $this->Attribute->search($search, $limit, $offset, $sort, $order);
Expand Down Expand Up @@ -189,4 +189,4 @@ public function delete()
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('attributes_definition_cannot_be_deleted')));
}
}
}
}
2 changes: 1 addition & 1 deletion application/controllers/Cashups.php
Expand Up @@ -25,7 +25,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? 'cashup_id' : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');
$filters = array(
'start_date' => $this->input->get('start_date'),
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Customers.php
Expand Up @@ -58,7 +58,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? LAST_NAME : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$customers = $this->Customer->search($search, $limit, $offset, $sort, $order);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Employees.php
Expand Up @@ -17,7 +17,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? LAST_NAME : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$employees = $this->Employee->search($search, $limit, $offset, $sort, $order);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Expenses.php
Expand Up @@ -30,7 +30,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? 'expense_id' : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');
$filters = array(
'start_date' => $this->input->get('start_date'),
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Expenses_categories.php
Expand Up @@ -24,7 +24,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? 'category_name' : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$expense_categories = $this->Expense_category->search($search, $limit, $offset, $sort, $order);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Giftcards.php
Expand Up @@ -24,7 +24,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? 'giftcard_number' : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$giftcards = $this->Giftcard->search($search, $limit, $offset, $sort, $order);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Item_kits.php
Expand Up @@ -59,7 +59,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? NAME : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$item_kits = $this->Item_kit->search($search, $limit, $offset, $sort, $order);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Items.php
Expand Up @@ -40,7 +40,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? NAME : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$this->item_lib->set_item_location($this->input->get('stock_location'));
Expand Down
6 changes: 3 additions & 3 deletions application/controllers/Sales.php
Expand Up @@ -54,10 +54,10 @@ public function get_row($row_id)
public function search()
{
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$sort = $this->input->post('sort') === NULL ? 'sales.sale_time' : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$filters = array('sale_type' => 'all',
'location_id' => 'all',
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Suppliers.php
Expand Up @@ -35,7 +35,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? LAST_NAME : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$suppliers = $this->Supplier->search($search, $limit, $offset, $sort, $order);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Tax_categories.php
Expand Up @@ -25,7 +25,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? 'tax_category' : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$tax_categories = $this->Tax_category->search($search, $limit, $offset, $sort, $order);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Tax_codes.php
Expand Up @@ -29,7 +29,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? 'tax_code_name' : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$tax_codes = $this->Tax_code->search($search, $limit, $offset, $sort, $order);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Tax_jurisdictions.php
Expand Up @@ -25,7 +25,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? 'jurisdiction_name' : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$tax_jurisdictions = $this->Tax_jurisdiction->search($search, $limit, $offset, $sort, $order);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Taxes.php
Expand Up @@ -57,7 +57,7 @@ public function search()
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$sort = $this->input->post('sort') === NULL ? 'tax_code_name' : $this->db->escape($this->input->get('sort'));
$order = $this->input->get('order');

$tax_rates = $this->Tax->search($search, $limit, $offset, $sort, $order);
Expand Down

0 comments on commit b4c48e5

Please sign in to comment.