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.96) (envelope-from ) id 1x5Zyj-0009bl-08 for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Sep 2026 02:30:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x5Zyh-00597P-24 for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Sep 2026 02:29:59 +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.96) (envelope-from ) id 1x5Pjy-001SQg-1u for pgsql-bugs@lists.postgresql.org; Sat, 12 Sep 2026 15:34:06 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x5Pjw-000000002OW-3DJn for pgsql-bugs@lists.postgresql.org; Sat, 12 Sep 2026 15:34:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=mfcOWicv+CKAFf+LkY7b0UdI9OJuCIHE555d9sMWIj0=; b=pf3Pkcu4sfH72O8X43wGNPOArH TVEAskxgf5s1nSB5hSS4J6gyhv/lHYQxEAJ4P4fYLOGw78fcZb67OtR4aqi/tZv5skxbkMH3JVO6Z YCf7c/aUTgp6B29mOWo37Npq54EUqjcFyoFhW/gKluY7VVoh1pi+5YMrgZm7C45XVk02Ip8yMPhrd ioKb3FiroG5QiJtaQ3jdwaa4HzsmuOBh0Gp9p8Bb2TPGkG+bHe8/dkfQ/1L2/IT333HnK+azJzziM j7V1gDjKLYSCNbC00OKUcPcGzitKZjKUboG2mj28JPCP/QwjsIbVQGvLdTd5HWsxWNee1/+DWbSpP Cu32i+Hw==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x5Pjw-0006YO-0I for pgsql-bugs@lists.postgresql.org; Sat, 12 Sep 2026 15:34:04 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x5Pjv-00000000Iun-1QXi for pgsql-bugs@lists.postgresql.org; Sat, 12 Sep 2026 15:34:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19685: START_REPLICATION accepts an overflowing LSN component To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: imchifan@163.com Reply-To: imchifan@163.com, pgsql-bugs@lists.postgresql.org Date: Sat, 12 Sep 2026 15:33:57 +0000 Message-ID: <19685-f3fd2336776ae0b8@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19685 Logged by: Qifan Liu Email address: imchifan@163.com PostgreSQL version: 18.6 Operating system: Linux/amd64 Description: =20 A logical replication command accepts the LSN 100000000/1, whose high hexadecimal component exceeds 32 bits, and proceeds to slot or configuration validation. Inference: the replication scanner accepts an unbounded hexadecimal component and converts it to uint32 without enforcing the canonical range. The verified behavior is limited to START_REPLICATION; other source-identified LSN parsing paths were not exercised. Impact: The replication protocol silently accepts and transforms an invalid position instead of reporting malformed input. This creates inconsistent validation relative to canonical pg_lsn input and may cause replication to begin from a position different from the one supplied. Successful replication from the transformed position was not tested, and no crash, corruption, or security impact was observed. Steps to reproduce ------------------ Prerequisites: - Run against a disposable PostgreSQL instance using a role allowed to issue replication protocol commands. ```sh psql -X -h /tmp 'dbname=3Dpostgres replication=3Ddatabase' -c 'START_REPLIC= ATION SLOT nonexistent_slot LOGICAL 100000000/1 (proto_version '"'"'1'"'"', publication_names '"'"'nonexistent_publication'"'"')' ``` Actual result ------------- ```text stderr: ERROR: replication slot "nonexistent_slot" does not exist PostgreSQL server log: 2026-09-12 12:39:14.640 UTC [286] ERROR: replication slot "nonexistent_slot" does not exist 2026-09-12 12:39:14.640 UTC [286] STATEMENT: START_REPLICATION SLOT nonexistent_slot LOGICAL 100000000/1 (proto_version '1', publication_names 'nonexistent_publication') ``` Expected result --------------- START_REPLICATION should reject the reproduced LSN 100000000/1 as out of range before performing replication-slot or wal_level validation. Additional information ---------------------- The issue was reproduced on PostgreSQL 20devel, PostgreSQL 18.6, and PostgreSQL 17.11.