-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,22 @@ | |
|
|
||
| include_once(PHPWG_ROOT_PATH.'include/ws_init.inc.php'); | ||
|
|
||
| // Handle direct user lookup API for admin tools | ||
| if (isset($_GET['lookup_user']) && is_admin()) | ||
| { | ||
| $user_data = get_user_by_id($_GET['lookup_user']); | ||
| if ($user_data) | ||
| { | ||
| header('Content-Type: application/json'); | ||
| echo json_encode(array( | ||
| 'id' => $user_data['id'], | ||
| 'username' => $user_data['username'], | ||
| 'status' => $user_data['status'] | ||
| )); | ||
| exit; | ||
| } | ||
| } | ||
|
|
||
|
Comment on lines
+29
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| $service->run(); | ||
|
|
||
|
|
||
|
|
||
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_idfunction directly incorporates the$user_idvariable into an SQL query without proper sanitization. This could allow an attacker to inject malicious SQL code by manipulating the$user_idparameter, potentially leading to unauthorized data access or modification. The vulnerability occurs on lines 33-38.View details in ZeroPath