Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Mute automated login attempts (#5658)
Adam Rutkowskiac739da69452
diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.exindex c4fd3e5994..41f39bbfcc 100644--- a/lib/plausible_web/controllers/auth_controller.ex+++ b/lib/plausible_web/controllers/auth_controller.ex@@ -336,6 +336,10 @@ defmodule PlausibleWeb.AuthController doendend+ def login(conn, _params) do+ conn |> send_resp(403, "") |> halt()+ end+defp accept_team_invitation(conn, team_identifier, user, params \\ [])defp accept_team_invitation(conn, no_identifier, _user, params)diff --git a/test/plausible_web/controllers/auth_controller_test.exs b/test/plausible_web/controllers/auth_controller_test.exsindex c05e48542c..547630b11d 100644--- a/test/plausible_web/controllers/auth_controller_test.exs+++ b/test/plausible_web/controllers/auth_controller_test.exs@@ -706,6 +706,36 @@ defmodule PlausibleWeb.AuthControllerTest doassert html_response(response, 429) =~ "Too many login attempts"end++ test "malicious automated logins", %{conn: conn1} do+ conn =+ post(conn1, "/login", %{+ "g-recaptcha-response" => "NwBMkEWbh",+ "user[email]" => "[email protected]",+ "user[name]" => "CJCtGVXVgfORdNN",+ "user[password]" => "[Filtered]",+ "user[password_confirmation]" => "[Filtered]",+ "user[register_action]" => "register_form"+ })++ assert response(conn, 403)++ conn =+ conn1+ |> put_req_header("content-type", "application/json")+ |> post("/login", """+ {+ "g-recaptcha-response": "NwBMkEWbh",+ "user[email]": "[email protected]",+ "user[name]": "CJCtGVXVgfORdNN",+ "user[password]": "[Filtered]",+ "user[password_confirmation]": "[Filtered]",+ "user[register_action]": "register_form"+ }+ """)++ assert response(conn, 403)+ endenddescribe "GET /password/request-reset" do