Skip to content

Fix error 500 on user creation, SQLI and windows debug php fix#1218

Closed
Leproide wants to merge 13 commits intoitflow-org:developfrom
Leproide:master
Closed

Fix error 500 on user creation, SQLI and windows debug php fix#1218
Leproide wants to merge 13 commits intoitflow-org:developfrom
Leproide:master

Conversation

@Leproide
Copy link

@Leproide Leproide commented May 1, 2025

johnnyq and others added 12 commits March 3, 2025 15:22
v25.02.2 Maint / Small Feature Release
v25.02.3 - Stable Minor Release
v25.02.4 - Stable Minor Release
Develop to Master for 25.03.3 release
Develop to Master for 25.03.4 Release
Develop to Master - 25.03.5 Release
require_once 'post/admin/admin_user_model.php';

$name = trim($_POST['name']);
$email = trim($_POST['email']);
$password_plain = trim($_POST['password']);
$password = password_hash($password_plain, PASSWORD_DEFAULT);
$user_specific_encryption_ciphertext = encryptUserSpecificKey($password_plain);
$role = intval($_POST['role']); // Evita injection anche qui

$stmt = $mysqli->prepare("INSERT INTO users 
    (user_name, user_email, user_password, user_specific_encryption_ciphertext, user_role_id) 
    VALUES (?, ?, ?, ?, ?)");
$stmt->bind_param("ssssi", $name, $email, $password, $user_specific_encryption_ciphertext, $role);
$stmt->execute();

$user_id = $stmt->insert_id;
Removed /dev/null (Not work on windows)
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello & Welcome! :)

Thanks for taking the time to help improve ITFlow. We're excited to review your contributions - we'll review this PR as soon as we can!

Whilst you're waiting, please feel free to check out the forum.

Just so you know, all contributions to ITFlow are licensed under the GNU GPL. By contributing you grant us a perpetual & irrevocable license to include your work in ITFlow.

];
$mail = addToMailQueue($data);

if ($mail !== true) {

Check failure

Code scanning / SonarCloud

Database queries should not be vulnerable to injection attacks High

Change this code to not construct SQL queries directly from user-controlled data. See more on SonarQube Cloud
$mail = addToMailQueue($data);

if ($mail !== true) {
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Mail', notification = 'Failed to send email to $email'");

Check failure

Code scanning / SonarCloud

Database queries should not be vulnerable to injection attacks High

Change this code to not construct SQL queries directly from user-controlled data. See more on SonarQube Cloud

}
}

Check failure

Code scanning / SonarCloud

Database queries should not be vulnerable to injection attacks High

Change this code to not construct SQL queries directly from user-controlled data. See more on SonarQube Cloud
}

if (!empty($two_fa) && $two_fa == 'disable') {
mysqli_query($mysqli, "UPDATE users SET user_token = '' WHERE user_id = '$user_id'");

Check failure

Code scanning / SonarCloud

Database queries should not be vulnerable to injection attacks High

Change this code to not construct SQL queries directly from user-controlled data. See more on SonarQube Cloud
@Leproide
Copy link
Author

Leproide commented May 1, 2025

Nice... other problem xD
I think this module need a rework (not my change)

require_once __DIR__ . '/config.php';
require_once __DIR__ . '/functions.php';
require_once __DIR__ . '/includes/check_login.php';
require_once __DIR__ . '/plugins/totp/totp.php'; // TOTP MFA Lib
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 1, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
E Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@wrongecho
Copy link
Collaborator

Hello. Thanks for getting in touch and looking this, but we have no interest in Windows support for now.

@wrongecho wrongecho closed this May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants