Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

fix(auth): enforce SSO-only server-side, not just in the UI (GHSA-vhv8-cw23-59xm) (#1246)

Miguel Ribeiroa81772eb0bb0
diff --git a/includes/version.php b/includes/version.php
index ba19a19..20e8689 100644
--- a/includes/version.php
+++ b/includes/version.php
@@ -1,3 +1,3 @@
<?php
-$version = "v5.8.1";
+$version = "v5.8.2";
?>
diff --git a/login.php b/login.php
index c90ab60..353b6f5 100644
--- a/login.php
+++ b/login.php
@@ -159,7 +159,11 @@ $loginFailed = false;
$hasSuccessMessage = (isset($_GET['validated']) && $_GET['validated'] == "true") || (isset($_GET['registered']) && $_GET['registered'] == true) ? true : false;
$userEmailWaitingVerification = false;
$oidcEmailNotVerified = false;
-if (isset($_POST['username']) && isset($_POST['password'])) {
+if (isset($_POST['username']) && isset($_POST['password']) && $password_login_disabled) {
+ // SSO-only is enforced here, not just by hiding the form: a direct POST
+ // must not be able to authenticate with a local password.
+ $loginFailed = true;
+} elseif (isset($_POST['username']) && isset($_POST['password'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$rememberMe = isset($_POST['remember']) ? true : false;