From e953b514fa4a291efd56cc108f17acdbb1c8992b Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Mon, 5 May 2025 11:10:26 -0400 Subject: [PATCH] feat(js): stop execution if the client disabled cookies (#438) Signed-off-by: Xe Iaso --- docs/docs/CHANGELOG.md | 1 + web/js/main.mjs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index 1f3073a..64b07d4 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Change import syntax to allow multi-level imports - Changed the startup logging to use JSON formatting as all the other logs do. - Added the ability to do [expression matching with CEL](./admin/configuration/expressions.mdx) +- Add a warning for clients that don't store cookies - Disable Open Graph passthrough by default ([#435](https://github.com/TecharoHQ/anubis/issues/435)) ## v1.17.1: Asahi sas Brutus: Echo 1 diff --git a/web/js/main.mjs b/web/js/main.mjs index c50ed2b..875d508 100644 --- a/web/js/main.mjs +++ b/web/js/main.mjs @@ -28,6 +28,11 @@ const dependencies = [ msg: "Your browser doesn't support web workers (Anubis uses this to avoid freezing your browser). Do you have a plugin like JShelter installed?", value: window.Worker, }, + { + name: "Cookies", + msg: "Your browser doesn't store cookies. Anubis uses cookies to determine which clients have passed challenges by storing a signed token in a cookie. Please enable storing cookies for this domain. The names of the cookies Anubis stores may vary without notice. Cookie names and values are not part of the public API.", + value: navigator.cookieEnabled, + }, ]; function showContinueBar(hash, nonce, t0, t1) { @@ -131,6 +136,7 @@ function showContinueBar(hash, nonce, t0, t1) { statusMsg: msg, imageSrc: imageURL("reject", anubisVersion, basePrefix), }); + return; } }