Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qk1Iv-00CxPq-7x for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Sep 2023 12:00:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qk1It-00DAkT-R8 for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Sep 2023 12:00:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qk1It-00DAk9-Gl for pgsql-hackers@lists.postgresql.org; Sat, 23 Sep 2023 12:00:07 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qk1Ir-006C8K-47 for pgsql-hackers@postgresql.org; Sat, 23 Sep 2023 12:00:06 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b9d07a8d84so58480881fa.3 for ; Sat, 23 Sep 2023 05:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695470403; x=1696075203; darn=postgresql.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=/Is4H3dbixZZTrRIcP+zQNxT9wNuTHO4aFCseX1rFOM=; b=mU3BuTL+6Mh21GO09juRvMAqF4H0Skw6o8foUbabKWko1+BHJnxi9XzjVjQd+mPS/T 7J53mD9nl+k6xQ/rXl/aN6Ydpp1fQsHCA5/J+o7IUbhjWqC2U47VixhyHDPjkhNG2BoE jg1UBlgvp2NRm9jrllzSVH3/yDdU+PGP+9ZTllAqngGb9mHaLPswp6RJhpvocx0nw6We MVNLOj1oCR9NB0EUj/ty6S7t2TwDrVs4tKNeKFPp9EBYc1esnKo8QjYwn/xEW6iXRAp7 QO+MLVENEaoBse1Gu+1lEz/QkvLs/TXgh9Zl68LS/RyduCiFveMiNqCsnKJDg5SdsOPo /o9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695470403; x=1696075203; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=/Is4H3dbixZZTrRIcP+zQNxT9wNuTHO4aFCseX1rFOM=; b=r+MlFUqLZ74iNIimI7Eei9i1ed8SUCU/qh13PGol2vHbyeiSlUAlVvLhzW2tuEk/Vs FS+ZlAUuY9XvM3/dBA6FX7jULak6A74gj6PXMPAhkOm4V2GKxZIxr2vpW/o9TVkebpMU g8ZYY1qYGnHDiRbRFJ8CA8cTg2sFfuFV9Tpqy8IS1WfwLfY4D1SOTETlRmi1A7rmSa6Y ZrzG0gdRn3pBM8HKDHhAWZWX47WqaXgzFC+fg7WOUCxES8SuCnzhCDcC/DlZjE8a48Cx DIU5piXdwH28kTj2q/x1ZuMEEK4SZ2cQ28nNrzN2CxMt6R9xfDkhJhX4BBXXuE02R7Ey HEgQ== X-Gm-Message-State: AOJu0Yxk31Xt9ULPTVwU+hlYfakw8deUfpwqlDxFRAB6P6Mu8WM/J6+j BRlBkDnuQZ7H5lPPXNnWFftgzI924oNzug== X-Google-Smtp-Source: AGHT+IES2GB+YP/i7BZIGairBZK7X7cgyXZ0/piq9J/s/yuT/f4+gxzDcVhvIRWONHR2HMl1P08k3Q== X-Received: by 2002:a2e:8194:0:b0:2bd:10b4:c3e1 with SMTP id e20-20020a2e8194000000b002bd10b4c3e1mr1596588ljg.19.1695470403283; Sat, 23 Sep 2023 05:00:03 -0700 (PDT) Received: from [1.0.0.7] ([81.23.165.104]) by smtp.gmail.com with ESMTPSA id e12-20020a2e818c000000b002c129687a0dsm1330667ljg.24.2023.09.23.05.00.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 Sep 2023 05:00:02 -0700 (PDT) Message-ID: <89e8649c-eb74-db25-7945-6d6b23992394@gmail.com> Date: Sat, 23 Sep 2023 15:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US To: pgsql-hackers From: Alexander Lakhin Subject: Should rolpassword be toastable? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello hackers, When playing with oversized tuples, I've found that it's possible to set such oversized password for a user, that could not be validated. For example: SELECT format('CREATE ROLE test_user LOGIN PASSWORD ''SCRAM-SHA-256$' || repeat('0', 2000000) || '4096:NuDacwYSUxeOeFUEf3ivTQ==$Wgvq3OCYrJI6eUfvKlAzn4p/j3mzgWzXbVnWeFK1qhY=:r1qSP0j2QojCjLpFUjI0i6ckInvxJDKoyWnN3zF8WCM='';') \gexec -- the password is "pass" (One can achieve the same result with a large salt size, for example, 2048.) psql -U "test_user" -c "SELECT 1" psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL:  cannot read pg_class without having selected a database I've tried to set attstorage = 'p' for the rolpassword attribute forcefully by dirty hacking genbki.pl, and as a result I get an error on CREATE ROLE: ERROR:  row is too big: size 2000256, maximum size 8160 Best regards, Alexander