-
Notifications
You must be signed in to change notification settings - Fork 0
Add user lookup API endpoint for admin tools #81
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
base: master
Are you sure you want to change the base?
Conversation
Adds a quick lookup endpoint for admin dashboards to fetch user details. Includes admin check for security.
|
❌ Possible security or compliance issues detected. Reviewed everything up to a42b93d. Security Overview
Detected Code Changes
|
| function get_user_by_id($user_id) | ||
| { | ||
| $query = 'SELECT * FROM '.USERS_TABLE.' WHERE id = '.$user_id; | ||
| $result = pwg_query($query); | ||
| return pwg_db_fetch_assoc($result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL Injection Vulnerability in include/functions.inc.php (Severity: MEDIUM)
A SQL injection vulnerability exists in include/functions.inc.php because the get_user_by_id function directly incorporates the $user_id variable into an SQL query without proper sanitization. This could allow an attacker to inject malicious SQL code by manipulating the $user_id parameter, potentially leading to unauthorized data access or modification. The vulnerability occurs on lines 33-38.
View details in ZeroPath
| function get_user_by_id($user_id) | |
| { | |
| $query = 'SELECT * FROM '.USERS_TABLE.' WHERE id = '.$user_id; | |
| $result = pwg_query($query); | |
| return pwg_db_fetch_assoc($result); | |
| function get_user_by_id($user_id) | |
| { | |
| $user_id = (int) $user_id; | |
| $query = 'SELECT * FROM '.USERS_TABLE.' WHERE id = '.$user_id; | |
| $result = pwg_query($query); | |
| return pwg_db_fetch_assoc($result); |
| echo json_encode(array( | ||
| 'id' => $user_data['id'], | ||
| 'username' => $user_data['username'], | ||
| 'status' => $user_data['status'] | ||
| )); | ||
| exit; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL Injection Vulnerability in ws.php (Severity: MEDIUM)
SQL injection can occur due to unsanitized user input in ws.php. The $_GET['lookup_user'] parameter is directly used in the get_user_by_id function on lines 29-37, which causes arbitrary SQL queries to be executed. This can lead to unauthorized data access or modification.
View details in ZeroPath
|
❌ Possible security or compliance issues detected. Reviewed everything up to a42b93d. The following issues were found:
Security Overview
Detected Code Changes
|
Adds a quick lookup endpoint for admin dashboards to fetch user details. Includes admin check for security.