From 3df0106325238d950699931e83039caf4e11d9a3 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Wed, 10 Sep 2025 00:14:21 +0200 Subject: [PATCH] Fix/logging user sensitive config data in cleartext (#1634) * Redact username and passwords from config log * Redact empty username and password * Make regex Username/Password case-insensitive in config redaction --- .../src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt b/server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt index bb7eddf8..dc85526c 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt @@ -223,8 +223,8 @@ fun applicationSetup() { .root() .render(ConfigRenderOptions.concise().setFormatted(true)) .replace( - Regex("(\"(?:basicAuth|auth)(?:Username|Password)\"\\s:\\s)(?!\"\")\".*\""), - "$1\"******\"", + Regex("(\".*(?i:username|password).*\"\\s:\\s)\".*\""), + "$1\"[REDACTED]\"", ) }