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 1uHcmA-00642K-OS for pgsql-bugs@arkaria.postgresql.org; Wed, 21 May 2025 06:18:02 +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 1uHcm9-003Tl4-50 for pgsql-bugs@arkaria.postgresql.org; Wed, 21 May 2025 06:18:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uHcm8-003TfZ-RQ for pgsql-bugs@lists.postgresql.org; Wed, 21 May 2025 06:18:00 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uHcm5-00059N-1D for pgsql-bugs@lists.postgresql.org; Wed, 21 May 2025 06:17:59 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-ad51ef2424bso964267466b.0 for ; Tue, 20 May 2025 23:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1747808276; x=1748413076; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=NSiBOIxBxJWNnkruoVUl5sVvmQj1DVxKstCa2/YEZyE=; b=BMYfvKiFmyrkh/2QhIG8lNidatQHuBOrvlyCWzKCfsDF/TZXj41Qhj6lZh6hiYu0iO iHW2utKX5apyZdvDU80LCU1kkpO470eAbkmQINS1TG7cQ5WIXcnmfDboCePvrmkw5+u6 GqnFNoyHmBjdAiY3+MTXXeuxhYgPTeWDZB/5qaAew/Nn8CHEyMPyT5EXxVnwQxEVoA8e sGuO9xLmFhq815BlekPoddWBCkGZqmN7gcDG69mFvvDXwOiZYBKY2IyLLQEny/gEOCRz mUiOsSWk+VnU5Eb056GNfnHa/a+ZUwW4QtOvK56AzreOs3DHjNxGttuOSRy/VOhwd2KW NTsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747808276; x=1748413076; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NSiBOIxBxJWNnkruoVUl5sVvmQj1DVxKstCa2/YEZyE=; b=RzonYhXPwUHUd9x9XtRMxuGgX0owXjTkr36TOO+5QQiSmTtmVoNo3cLGN/LShu6hU5 9jQvd3td6vuwuW/2JOMK5cI6V8I8UTB5aS8Tb533SRKFFQkwPosks7sGgZpg5GoiwF5U Bv07fYIrOMDF2w/Os3PpgoQqwQrVA91GqCAwLBDvhVTtIuPycTOQYcBFu9m+C2Zgg01V Am76XjbeHJNJH7GWSo8hnW0NF6hh/NPNi/Yohe0zKMtYgOxttGM0PkIq9OKDbyUavvYn FFEkv6U10yLpnSjOB/KfQsaQ8fQhz9M0bxLD6BjQzC7HmrJg9IG9NRIp1nO0AzkqFR7Y zIBA== X-Forwarded-Encrypted: i=1; AJvYcCWih8+TSw3MRMxyasowQ7y+bnzlEeqU71es2+/qIDsgtc3WEAzLMX6uBejJ2wQB3nw4YkD32NEA8FgG@lists.postgresql.org X-Gm-Message-State: AOJu0YzNCEQB2gvSz9aS1DRp/GasD2E9I/2sfPKw669F3Y8DZUEVRc9J UQ2cN9jIlSl7LoNYvmopGPumsZhBHJqQs8/fnavd8B6LR3NpOVII6lB0WvjnO7lAw74= X-Gm-Gg: ASbGncvaWIyeW4kRRi2l+xJvqrArqBMN0hUmAf4DEBIAUW8tz96NXsMlE1/a9b1LNxp 6GkA7wKoMYG1p0/zRHbB4hPMVHKct+TmfwYrE9k9ze+agI2Uy5vFYM85FeCVPUWqfMZSsMg4QiW NFtG12Gjs2WwfggwBWIFgJwdbJc58HNJ+KYQ09VdKRn0A3HCM0qC0Nzq5ugIa9RuWAQyP79pm5X 1lYO0ngXSbSmf4OTZHhMnPFwc8jML/HrD7m5qR+9/Jr1/UpzpTYU1oypChmy48cS+/UoqXvoDOM Ao/G1yzfE/JLlOmgG/7lEiY514gC0d7UMpD0+oov0rYK4gL+CJm+w8kE3bjguxAPkXqNybMkMzA Z X-Google-Smtp-Source: AGHT+IFHJE89gGo0eD2qAMX08L6vq8G2ZpYNUZqfRv574jgUX9ePnffB5SZkbHypcdE2GID//3wiVg== X-Received: by 2002:a17:907:7e94:b0:ad2:409f:fe7c with SMTP id a640c23a62f3a-ad52d5d46dbmr1669031866b.42.1747808276321; Tue, 20 May 2025 23:17:56 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([41.66.98.31]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad52d4c9e56sm846924766b.156.2025.05.20.23.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 23:17:56 -0700 (PDT) Message-ID: Subject: Re: BUG #18936: Trigger enable users to modify the tables which he doesn't have privilege From: Laurenz Albe To: 798604270@qq.com, pgsql-bugs@lists.postgresql.org Date: Wed, 21 May 2025 08:17:53 +0200 In-Reply-To: <18936-197af1cbbd49156f@postgresql.org> References: <18936-197af1cbbd49156f@postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.1 (3.56.1-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-05-20 at 13:07 +0000, PG Bug reporting form wrote: > If an attacker gains privileges on a table, they can exploit triggers to > modify or exfiltrate data from other tables, provided the trigger can be > activated by either a superuser or a user with privileges on the target > tables. That's working as designed. If a superuser performs a data modification on a table owned by an untrustworthy user, it is "game over". That is one of the reasons why you should use a superuser only for tasks that require superuser privileges. Yours, Laurenz Albe