# Vitess v23.0.9

2026-12-02 · [元のリリースノート](https://github.com/vitessio/vitess/releases/tag/v23.0.9) · [全体のまとめ](https://ratatosk.io/ja/releases/vitess/v23.0.9)

セキュリティ 19 · 破壊的変更 1 · 重大な修正 3 · 機能・改善 1 · その他の変更 1

## アップグレード前の確認事項

### 前提条件

- **既存 znode の ACL 更新**: アップグレード前に作成された znode の ACL は、認証ファイルを設定した状態で全コンポーネントが v23.0.9 で稼働すると変更されます。PR では、アップグレード前に全コンポーネントへ認証ファイルを設定する方法と、認証ファイルを設定して一度のロールアウトで全コンポーネントを再起動する方法についても説明しています。
  > - Znodes created before the upgrade keep their `world:anyone` ACLs. Once every component runs this release with the auth file, run `addauth digest <user>:<password>` in `zkCli.sh`, then `setAcl -R <parent> auth::cdrwa` on the common parent of the global and cell roots (for example `/vitess`), in each ZooKeeper ensemble. Credential rotation and first-time setup are described in [#22231](https://github.com/vitessio/vitess/pull/22231).
- **アップグレード前に必要な gRPC mTLS サブジェクト照合**: アップグレード前に、`--grpc-auth-mtls-allowed-substrings` に空でない値を設定する必要があります。また、各クライアント証明書のサブジェクトは、Go の書式で表したときに、その値のいずれかを含んでいる必要があります。
  > - Before upgrading, set the flag to non-empty entries, and check that each client certificate's subject, as Go formats it (`CN=vtctld,OU=Vitess,O=Example,C=US`), contains one of them.
- **解析できないパーティション管理文の拒否**: 例外対象外で、複数のパーティション定義を含む `ADD PARTITION` 文、または `ADD PARTITION PARTITIONS n` 文は、パーサーが完全に解析できない場合に拒否されます。ジョブの失敗は後になって、RANGE テーブルの最終境界を超える挿入の失敗として表面化することがあります。
  > - Partition maintenance that the parser doesn't fully parse is denied for non-exempt callers, such as `ADD PARTITION` with more than one partition definition, or `ADD PARTITION PARTITIONS n`. Add one partition per statement, or run the job as the exempt user. A failing job may only show up later, as inserts that fail past a RANGE table's last bound.

### 既知の問題

- **リリース前に作成されたテーブルバインディングのアップグレード後の保持**: 過去の `EXCHANGE PARTITION` の実行履歴は、バイナリログまたは監査ログ以外には残りません。
  > - Upgrading doesn't undo bindings made before it. Find MERGE and FEDERATED tables on each shard's primary with `SELECT table_schema, table_name, engine FROM information_schema.tables WHERE engine IN ('MRG_MYISAM', 'FEDERATED')`, check each one's `UNION` list or `CONNECTION` string with `SHOW CREATE TABLE`, and drop any binding that isn't intended. A past `EXCHANGE PARTITION` leaves no such trace; only the binary log or an audit log shows it.

## セキュリティ (19)

### vttestserver から vtcombo への ZooKeeper 認証・TLS フラグの引き継ぎ

- 影響対象: 外部トポロジを使用する vttestserver の構成
- 追加の対応: 該当する `--topo-zk-auth-file` および／または `--topo-zk-tls-*` フラグが設定済み
- [GHSA-9c2c-hxwj-c5jr](https://github.com/vitessio/vitess/security/advisories/GHSA-9c2c-hxwj-c5jr)

以前は、vtcombo が同じ ZooKeeper ID や TLS 設定を使用していなかったため、オープンなルート配下に `world:anyone` の znode が残る可能性がありました。現在は vttestserver と同じ ID で認証し、同じ TLS 設定を使って ZooKeeper に接続します。

> With `--topo-zk-auth-file` set, `zk2topo` authenticated its ZooKeeper session but still created every znode, lock and election nodes included, with a `world:anyone` ACL, so any client that could reach the ensemble could read, change or delete the topology ([GHSA-9c2c-hxwj-c5jr](https://github.com/vitessio/vitess/security/advisories/GHSA-9c2c-hxwj-c5jr)). Znodes are now created with ZooKeeper's `auth` ACL scheme, so only the auth file's identity can access them. A missing, unreadable or malformed auth file, or a failed `AddAuth`, now fails the connection instead of continuing unauthenticated. A `digest` auth file must hold both a user and a password, and a trailing CR is dropped like a trailing LF. `vtctldclient`, `topo2topo` and the `zk` tool now take the `--topo-zk-*` flags, and `vttestserver` passes `--topo-zk-auth-file` and the `--topo-zk-tls-*` flags on to `vtcombo`. Without an auth file, nothing changes.

### mTLS 認可で検証済み証明書を確認し、空の部分文字列エントリーを拒否

- 影響対象: `--grpc-auth-mtls-allowed-substrings` が未設定、空、またはコロン区切りの空エントリーを含む mTLS プロセス
- 追加の対応: 各クライアント証明書の Go 形式の subject に一致する、空でない許可部分文字列エントリー
- [GHSA-xhx6-rmm2-5h2p](https://github.com/vitessio/vitess/security/advisories/GHSA-xhx6-rmm2-5h2p)

以前は、検証済みのリーフ証明書が許可された subject に一致しなくても、追加された自己署名証明書が一致すればクライアントが許可されることがありました。リーフ以外の証明書だけが一致するクライアントからの RPC は、`Unauthenticated` で失敗するようになりました。空のエントリーがある場合、起動時に `Failed to load auth plugin` という致命的エラーでプロセスが終了するようになりました。

> With `--grpc-auth-mode=mtls`, `--grpc-auth-mtls-allowed-substrings` was matched against every certificate the client presented, not just the one verified against `--grpc-ca`. A client with any certificate from that CA could append a self-signed certificate with an allowed subject and be admitted ([GHSA-xhx6-rmm2-5h2p](https://github.com/vitessio/vitess/security/advisories/GHSA-xhx6-rmm2-5h2p)). The flag is now matched only against the subject of the verified leaf certificate. In mtls mode the flag can also no longer have an empty entry, which matched every subject: an unset or empty value (the default), or a leading, trailing or repeated colon, such as in `CN=vtctld:`.
> - A process started with `--grpc-auth-mode=mtls` logs `Failed to load auth plugin` as a fatal error, with a dump of all goroutines, and exits if `--grpc-auth-mtls-allowed-substrings` has an empty entry.

### Reshard ワークフローのフィルター置換の修正

- 影響対象: `Reshard` `SwitchTraffic` を使用するキースペース

`Reshard` の `SwitchTraffic` 実行時、同じキースペース内の別のワークフローに `{{` を含むフィルターがあると（移動対象のテーブル名など）、ソースへの書き込みを停止した後にそのフィルターが書き換えられたり、`vtctld` がクラッシュしたりする可能性がありました。コマンドはキー範囲プレースホルダーだけを文字どおりに置換し、それ以外の `{{` を含むフィルターは拒否するようになりました。書き込みはソースシャードにとどまり、同じコマンドで切り替えたレプリカと rdonly の読み取りは切り替わった状態を維持し、`--dry-run` でもエラーが報告されます。

> `CopySchemaShard`, which `Reshard` also runs for each new shard unless `--skip-schema-copy` is set, filled the `{{.DatabaseName}}` placeholder by executing each copied `SHOW CREATE` statement as a Go `text/template`. A user able to run DDL could put template actions in, for example, a table comment, and make Vitess run arbitrary SQL as the DBA user on the destination primaries ([GHSA-7g75-v57j-2ghw](https://github.com/vitessio/vitess/security/advisories/GHSA-7g75-v57j-2ghw)). The same pattern existed when a Reshard migrates the keyspace's other workflows (each stream's filter, which can contain table names, was executed as a template to fill in the key range) and in the legacy `vtctl` materializer (`MoveTables`, `Materialize`, `Migrate`, `CreateLookupVindex`). VDiff's `--debug-query` used the diffed query's `FROM` clause as a format string, so a `%` in a table name crashed vttablet. Placeholders are now substituted literally, and nothing else in the text is interpreted.
> - A Reshard's `SwitchTraffic` fails to switch writes if another workflow in the keyspace has a filter that contains `{{`, for example a moved table whose name contains it. Writes stay on the source shards; replica and rdonly reads that the same command switched stay switched, and `--dry-run` reports the error.

### バッファー再利用に伴う VTGate MySQL のパケット読み取り不具合の修正

- 影響対象: 認証切り替え応答またはレプリケーションコマンドを処理する VTGate MySQL サーバー接続
- [GHSA-g6c2-qp3p-x2w2](https://github.com/vitessio/vitess/security/advisories/GHSA-g6c2-qp3p-x2w2)

ログイン中に、認証切り替え応答、レプリケーションコマンドの引数、一部の不正なコマンドへのエラー応答で、パケットバッファーが共有プールに返却された後、別の接続によって上書きされたバイト列が使われる可能性がありました。修正後は、レプリケーションコマンドをバッファーの再利用前に解析し、認証切り替え応答には別のバッファーを使い、再利用される読み取りパケットをクリアします。

> - Fixes [GHSA-g6c2-qp3p-x2w2](https://github.com/vitessio/vitess/security/advisories/GHSA-g6c2-qp3p-x2w2): the VTGate MySQL server kept reading a client's packet after returning its buffer to the shared buffer pool, where another connection could overwrite it. The auth switch response checked during login, the arguments of the replication commands, and the error replies to some malformed commands could use bytes from another connection's packet. See [#22247](https://github.com/vitessio/vitess/pull/22247).

### ZooKeeper znode ACL の認証済み ID への制限

- 影響対象: `--topo-zk-auth-file` を使用する ZooKeeper トポロジ
- 追加の対応: 全コンポーネントで認証ファイルを指定して v23.0.9 を実行した後、各アンサンブルの共通親ノードで `addauth digest <user>:<password>` と `setAcl -R <parent> auth::cdrwa` を実行
- [GHSA-9c2c-hxwj-c5jr](https://github.com/vitessio/vitess/security/advisories/GHSA-9c2c-hxwj-c5jr)

これまでは、認証ファイルを設定していても、アンサンブルに接続できるクライアントであればトポロジの znode を読み取り、変更、削除できました。新しく作成される znode は認証済みの ID に制限されます。アップグレード前に作成された znode は、別途変更されるまで既存の ACL を維持します。

> ### ZooKeeper topology znodes are restricted to the `--topo-zk-auth-file` identity
> With `--topo-zk-auth-file` set, `zk2topo` authenticated its ZooKeeper session but still created every znode, lock and election nodes included, with a `world:anyone` ACL, so any client that could reach the ensemble could read, change or delete the topology ([GHSA-9c2c-hxwj-c5jr](https://github.com/vitessio/vitess/security/advisories/GHSA-9c2c-hxwj-c5jr)). Znodes are now created with ZooKeeper's `auth` ACL scheme, so only the auth file's identity can access them. A missing, unreadable or malformed auth file, or a failed `AddAuth`, now fails the connection instead of continuing unauthenticated. A `digest` auth file must hold both a user and a password, and a trailing CR is dropped like a trailing LF. `vtctldclient`, `topo2topo` and the `zk` tool now take the `--topo-zk-*` flags, and `vttestserver` passes `--topo-zk-auth-file` and the `--topo-zk-tls-*` flags on to `vtcombo`. Without an auth file, nothing changes.
> - Every component that shares the topology must use the same ZooKeeper identity, `vtctldclient --server internal` and `topo2topo` included. A component with another identity, or none, gets `zk: not authenticated`.

### ZooKeeper トポロジーアクセスで認証エラー時に接続を拒否する動作

- 影響対象: `--topo-zk-auth-file` を使用するデプロイメント
- 追加の対応: 既存の znode の ACL 更新。全コンポーネントが認証ファイルを指定してこのリリースを実行した後、各 ZooKeeper アンサンブルで、グローバルルートとセルルートに共通する親に対して `addauth digest <user>:<password>` を実行し、続けて `setAcl -R <parent> auth::cdrwa` を実行
- [GHSA-9c2c-hxwj-c5jr](https://github.com/vitessio/vitess/security/advisories/GHSA-9c2c-hxwj-c5jr)

これまでは、認証ファイルが存在しない、読み取れない、または形式が不正な場合や、`AddAuth` の呼び出しに失敗した場合に、コンポーネントが未認証のままになることがありました。また、`digest` ファイルにユーザー名とパスワードの両方が含まれている必要もありませんでした。今後は、これらの条件が発生すると、接続またはトポロジー関連の呼び出しが失敗します。

> With `--topo-zk-auth-file` set, `zk2topo` authenticated its ZooKeeper session but still created every znode, lock and election nodes included, with a `world:anyone` ACL, so any client that could reach the ensemble could read, change or delete the topology ([GHSA-9c2c-hxwj-c5jr](https://github.com/vitessio/vitess/security/advisories/GHSA-9c2c-hxwj-c5jr)). Znodes are now created with ZooKeeper's `auth` ACL scheme, so only the auth file's identity can access them. A missing, unreadable or malformed auth file, or a failed `AddAuth`, now fails the connection instead of continuing unauthenticated. A `digest` auth file must hold both a user and a password, and a trailing CR is dropped like a trailing LF. `vtctldclient`, `topo2topo` and the `zk` tool now take the `--topo-zk-*` flags, and `vttestserver` passes `--topo-zk-auth-file` and the `--topo-zk-tls-*` flags on to `vtcombo`. Without an auth file, nothing changes.
> - A component whose auth file can't be read or parsed, or a `digest` file without a password, now fails every topology call. Before upgrading, check that no component logs `failed to read topo-zk-auth-file`, `failed to parse topo-zk-auth-file contents` or `failed to add auth from topo-zk-auth-file`.

### gRPC mTLS の許可リスト検査を検証済みリーフ証明書に限定

- 影響対象: `--grpc-auth-mode=mtls` を設定した gRPC 相互 TLS
- [GHSA-xhx6-rmm2-5h2p](https://github.com/vitessio/vitess/security/advisories/GHSA-xhx6-rmm2-5h2p)

以前は、`--grpc-ca` による検証に合格した証明書を持つクライアントでも、許可された部分文字列にサブジェクトが一致する自己署名証明書を追加すると、接続が許可される場合がありました。許可リストのエントリーがリーフ以外の証明書にしか一致しないクライアントでは、コンポーネント RPC が `client certificate not authorized`（`Unauthenticated`）で失敗する場合があります。

> With `--grpc-auth-mode=mtls`, `--grpc-auth-mtls-allowed-substrings` was matched against every certificate the client presented, not just the one verified against `--grpc-ca`. A client with any certificate from that CA could append a self-signed certificate with an allowed subject and be admitted ([GHSA-xhx6-rmm2-5h2p](https://github.com/vitessio/vitess/security/advisories/GHSA-xhx6-rmm2-5h2p)). The flag is now matched only against the subject of the verified leaf certificate. In mtls mode the flag can also no longer have an empty entry, which matched every subject: an unset or empty value (the default), or a leading, trailing or repeated colon, such as in `CN=vtctld:`.
> - An entry that matches only a non-leaf certificate, such as an intermediate CA's subject, no longer admits the client. RPCs between components, such as VTGate, VTOrc or vtctld calling an upgraded VTTablet, can fail with `client certificate not authorized` (gRPC code `Unauthenticated`), which the server doesn't log.

### オプション指定テーブルの厳格な ACL チェックの修正

- 影響対象: 厳格なテーブル ACL の下で他のテーブルを指定するテーブルオプション
- 追加の対応: `--queryserver-config-strict-table-acl`
- [GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)

従来は `CREATE TABLE` または `ALTER TABLE` で指定されたテーブルだけを確認していたため、そのテーブルに対する ADMIN 権限を持つユーザーは、ACL で拒否されていても MERGE の `UNION=(...)` オプションで指定されたテーブルを読み書きできました。今後、オプションで指定されたテーブルにも READER と WRITER の両方が必要となり、いずれかの権限が不足する操作は拒否されます。

> Under strict table ACL (`--queryserver-config-strict-table-acl`), only the table a `CREATE TABLE` or `ALTER TABLE` names was checked. A MERGE table's `UNION=(...)` option, a `CREATE TABLE ... LIKE` of a MERGE table, and `ALTER TABLE ... EXCHANGE PARTITION` let a user with ADMIN on one table read and write tables the ACL denied them, and so could a FEDERATED table's `CONNECTION` string where that engine is enabled ([GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)). Now:
> - tables named by a table option, and the source of `CREATE TABLE ... LIKE`, require READER and WRITER;

### `CREATE TABLE ... LIKE` におけるコピー元テーブル ACL 回避の修正

- 影響対象: strict table ACL が有効なタブレット
- 追加の対応: `--queryserver-config-strict-table-acl` の有効化
- [GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)

以前は、`CREATE TABLE ... LIKE` がコピー元テーブルの ACL を回避でき、あるテーブルで `ADMIN` 権限を持つユーザーが、ACL で拒否されているテーブルの読み取りと書き込みを行えました。現在は、コピー元テーブルに対する `READER` と `WRITER` の権限が呼び出し元に必要です。

> Under strict table ACL (`--queryserver-config-strict-table-acl`), only the table a `CREATE TABLE` or `ALTER TABLE` names was checked. A MERGE table's `UNION=(...)` option, a `CREATE TABLE ... LIKE` of a MERGE table, and `ALTER TABLE ... EXCHANGE PARTITION` let a user with ADMIN on one table read and write tables the ACL denied them, and so could a FEDERATED table's `CONNECTION` string where that engine is enabled ([GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)). Now:
> - tables named by a table option, and the source of `CREATE TABLE ... LIKE`, require READER and WRITER;

### パーティション交換時の ACL 回避の修正

- 影響対象: 厳格なテーブル ACL が有効なタブレット
- [GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)

従来、`ALTER TABLE ... EXCHANGE PARTITION` では指定されたテーブルのみを確認していたため、ユーザーが ACL に反してもう一方のテーブルを読み書きできる可能性がありました。現在は両方のテーブルで ADMIN、READER、WRITER が必要です。

> Under strict table ACL (`--queryserver-config-strict-table-acl`), only the table a `CREATE TABLE` or `ALTER TABLE` names was checked. A MERGE table's `UNION=(...)` option, a `CREATE TABLE ... LIKE` of a MERGE table, and `ALTER TABLE ... EXCHANGE PARTITION` let a user with ADMIN on one table read and write tables the ACL denied them, and so could a FEDERATED table's `CONNECTION` string where that engine is enabled ([GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)). Now:
> - both tables of `EXCHANGE PARTITION` require ADMIN, READER and WRITER;

### 厳格なテーブル ACLでテーブル集合を特定できないステートメントの拒否

- 影響対象: 厳格なテーブル ACL を使用するタブレット
- 追加の対応: `--queryserver-config-strict-table-acl`
- [GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)

以前は、部分的に解析された `ALTER TABLE` と `CREATE INDEX` のステートメントが MySQL に転送されていたため、解析されていない末尾部分で、プランナーが確認していないテーブルを指定できました。現在は、Vitess がテーブル集合を特定できない場合、これらのステートメントは拒否されます。また、この拒否は `CONNECTION` を設定する `CREATE TABLE` または `ALTER TABLE` のステートメントにも適用されますが、記載された ACL の例外と、全ロールのテーブルグループに関する例外が適用されます。

> Under strict table ACL (`--queryserver-config-strict-table-acl`), only the table a `CREATE TABLE` or `ALTER TABLE` names was checked. A MERGE table's `UNION=(...)` option, a `CREATE TABLE ... LIKE` of a MERGE table, and `ALTER TABLE ... EXCHANGE PARTITION` let a user with ADMIN on one table read and write tables the ACL denied them, and so could a FEDERATED table's `CONNECTION` string where that engine is enabled ([GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)). Now:
> - a partially parsed `ALTER TABLE` or `CREATE INDEX`, and a `CREATE TABLE` or `ALTER TABLE` that sets `CONNECTION`, are denied with `command denied ... for a table set that cannot be determined`. The exceptions are the exempt ACL (`--queryserver-config-acl-exempt-acl`) and a caller with every role in a table group covering every table (`%`).

### 厳格なテーブル ACL による CONNECTION 文の拒否

- 影響対象: 厳格なテーブル ACL を有効にした tablet
- 追加の対応: `--queryserver-config-strict-table-acl`
- [GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)

以前は、`CONNECTION` 文字列でテーブルを別のテーブルに結び付ける際、結び付け先のテーブルが ACL に照合されず、ACL で拒否される読み取りや書き込みが可能でした。この点は、FEDERATED テーブルについて、そのエンジンが有効な場合に指摘されています。現在は、エンジンの種類にかかわらず、`CONNECTION` を設定する `CREATE TABLE` 文と `ALTER TABLE` 文が拒否されます。ただし、除外 ACL と、すべてのテーブル（`%`）を対象とするテーブルグループ内の全ロールを持つ呼び出し元は対象外です。

> Under strict table ACL (`--queryserver-config-strict-table-acl`), only the table a `CREATE TABLE` or `ALTER TABLE` names was checked. A MERGE table's `UNION=(...)` option, a `CREATE TABLE ... LIKE` of a MERGE table, and `ALTER TABLE ... EXCHANGE PARTITION` let a user with ADMIN on one table read and write tables the ACL denied them, and so could a FEDERATED table's `CONNECTION` string where that engine is enabled ([GHSA-q4ch-mhpm-9368](https://github.com/vitessio/vitess/security/advisories/GHSA-q4ch-mhpm-9368)). Now:
> - a partially parsed `ALTER TABLE` or `CREATE INDEX`, and a `CREATE TABLE` or `ALTER TABLE` that sets `CONNECTION`, are denied with `command denied ... for a table set that cannot be determined`. The exceptions are the exempt ACL (`--queryserver-config-acl-exempt-acl`) and a caller with every role in a table group covering every table (`%`).

### 厳格なテーブル ACL による未対応の `SERIAL` 列の拒否

- 影響対象: 厳格なテーブル ACL を有効にしたタブレット
- 追加の対応: `--queryserver-config-strict-table-acl`

パーサーは `SERIAL` をサポートしていません。`BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE` と明示すれば、未対応の型構文を回避できます。

> - On this release the parser also has no `SERIAL` column type, so an `ALTER TABLE` that defines a `SERIAL` column is denied as well. Spell the type out (`BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE`).

### `CopySchemaShard` での危険なテンプレート実行の修正

- 影響対象: `CopySchemaShard` を使用する構成（`--skip-schema-copy` を指定しない `Reshard` のスキーマコピーを含む）
- [GHSA-7g75-v57j-2ghw](https://github.com/vitessio/vitess/security/advisories/GHSA-7g75-v57j-2ghw)

DDLを実行できるユーザーがコピー対象の定義にテンプレートアクションを埋め込むと、宛先のプライマリで DBA 権限による任意の SQL が実行される可能性がありました。また、不正なアクションによって `CopySchemaShard` がパニックしたり、`Reshard` 中に `vtctld` がクラッシュしたりする可能性もありました。コピーした定義ではテンプレートアクションを文字列として扱うようになり、データベース名の置換後に複数のステートメントが残る場合は拒否されます。

> `CopySchemaShard`, which `Reshard` also runs for each new shard unless `--skip-schema-copy` is set, filled the `{{.DatabaseName}}` placeholder by executing each copied `SHOW CREATE` statement as a Go `text/template`. A user able to run DDL could put template actions in, for example, a table comment, and make Vitess run arbitrary SQL as the DBA user on the destination primaries ([GHSA-7g75-v57j-2ghw](https://github.com/vitessio/vitess/security/advisories/GHSA-7g75-v57j-2ghw)). The same pattern existed when a Reshard migrates the keyspace's other workflows (each stream's filter, which can contain table names, was executed as a template to fill in the key range) and in the legacy `vtctl` materializer (`MoveTables`, `Materialize`, `Migrate`, `CreateLookupVindex`). VDiff's `--debug-query` used the diffed query's `FROM` clause as a format string, so a `%` in a table name crashed vttablet. Placeholders are now substituted literally, and nothing else in the text is interpreted.
> - `CopySchemaShard`, and so `Reshard`'s schema copy, refuses a copied definition that is more than one statement once the database name is filled in.

### VDiff の `ANALYZE TABLE` 識別子エスケープの修正

- 影響対象: `--update-table-stats` を指定した VDiff の実行
- [GHSA-mmjh-49cg-g5v2](https://github.com/vitessio/vitess/security/advisories/GHSA-mmjh-49cg-g5v2)

データベース名またはテーブル名にバッククォートが含まれる場合、識別子がエスケープされず、意図したテーブルを分析しないステートメントが生成されることがありました。VDiff は、識別子内に含まれるバッククォートも含め、両方の識別子をエスケープするようになりました。通常のテーブル名では、生成されるステートメントに変更はありません。

> - Fixes [GHSA-mmjh-49cg-g5v2](https://github.com/vitessio/vitess/security/advisories/GHSA-mmjh-49cg-g5v2): SQL injection through table names in the `ANALYZE TABLE` that VDiff runs for `--update-table-stats`. See [#22243](https://github.com/vitessio/vitess/pull/22243).

### 不明な `COM_SET_OPTION` 操作に対して VTGate がエラーのみを返す変更

- 影響対象: `COM_SET_OPTION` を使用する VTGate の MySQL クライアント
- [GHSA-g6c2-qp3p-x2w2](https://github.com/vitessio/vitess/security/advisories/GHSA-g6c2-qp3p-x2w2)

不明な操作に対して、従来はエラーの後に OK を返していたため、クライアントの応答が1つずれていました。コマンド形式が不正な場合のエラーテキストは異なることがありますが、エラーコードと SQLSTATE は変わりません。

> - Fixes [GHSA-g6c2-qp3p-x2w2](https://github.com/vitessio/vitess/security/advisories/GHSA-g6c2-qp3p-x2w2): the VTGate MySQL server kept reading a client's packet after returning its buffer to the shared buffer pool, where another connection could overwrite it. The auth switch response checked during login, the arguments of the replication commands, and the error replies to some malformed commands could use bytes from another connection's packet. See [#22247](https://github.com/vitessio/vitess/pull/22247).

### VTGate の `COM_REGISTER_SLAVE` パケット長チェックの追加

- 影響対象: `COM_REGISTER_SLAVE` パケットを処理する VTGate の MySQL サーバー接続
- [GHSA-g6c2-qp3p-x2w2](https://github.com/vitessio/vitess/security/advisories/GHSA-g6c2-qp3p-x2w2)

パケットで宣言されたホスト名、ユーザー名、またはパスワードの長さがパケットの範囲を超えている場合、パーサーが範囲外を読み取ったり、パニックを起こして接続を閉じたりする可能性がありました。

> - Fixes [GHSA-g6c2-qp3p-x2w2](https://github.com/vitessio/vitess/security/advisories/GHSA-g6c2-qp3p-x2w2): the VTGate MySQL server kept reading a client's packet after returning its buffer to the shared buffer pool, where another connection could overwrite it. The auth switch response checked during login, the arguments of the replication commands, and the error replies to some malformed commands could use bytes from another connection's packet. See [#22247](https://github.com/vitessio/vitess/pull/22247).

### VDiff と Reshard の `stop_pos` 更新におけるレプリケーション位置のエスケープ処理

- 影響対象: ソースタブレットのレプリケーション位置を `stop_pos` に書き込む VDiff と Reshard のワークフロー
- [GHSA-hqg6-fhvc-3vmf](https://github.com/vitessio/vitess/security/advisories/GHSA-hqg6-fhvc-3vmf)

以前は、ソースタブレットのレプリケーション位置に引用符が含まれていると（`FilePos` のファイル名に含まれる場合も含む）、SQL 文が不正になったり、SQL インジェクションにつながったりする可能性がありました。VDiff がスナップショット位置を書き込むときや、Reshard が書き込み先を切り替えるときに発生する可能性がありました。

> - Fixes [GHSA-hqg6-fhvc-3vmf](https://github.com/vitessio/vitess/security/advisories/GHSA-hqg6-fhvc-3vmf): SQL injection through a replication position from a source tablet in the `stop_pos` update that VDiff runs and in the update that `Reshard` runs when switching writes. See [#22250](https://github.com/vitessio/vitess/pull/22250).

### ソース位置を介した VDiff の SQL インジェクション修正

- 影響対象: VDiff の実行
- [GHSA-hqg6-fhvc-3vmf](https://github.com/vitessio/vitess/security/advisories/GHSA-hqg6-fhvc-3vmf)

ソースタブレットが解析できないスナップショット位置を報告した場合、VDiff はその位置を待つ処理で失敗する前に、ターゲットストリームの `stop_pos` を更新していました。VDiff はソース位置を先に解析するようになりました。無効な値の場合は更新前に失敗し、有効な値の場合は再エンコードして保存します。ターゲットのスナップショット位置は解析されません。

> - Fixes [GHSA-hqg6-fhvc-3vmf](https://github.com/vitessio/vitess/security/advisories/GHSA-hqg6-fhvc-3vmf): SQL injection through a replication position from a source tablet in the `stop_pos` update that VDiff runs and in the update that `Reshard` runs when switching writes. See [#22250](https://github.com/vitessio/vitess/pull/22250).

## 破壊的変更 (1)

### 旧 `vtctl` `Materialize` におけるソース式のプレースホルダー置換の停止

- 影響対象: `{{.keyrange}}` または `{{.dbname}}` を使う旧 `vtctl` `Materialize` のソース式

これまでは、ソース式内のこれらのプレースホルダーがターゲットのキーレンジまたはデータベース名に置き換えられていました。この非公開仕様の置換に依存していた式では、プレースホルダーがそのまま残るようになります。

> `CopySchemaShard`, which `Reshard` also runs for each new shard unless `--skip-schema-copy` is set, filled the `{{.DatabaseName}}` placeholder by executing each copied `SHOW CREATE` statement as a Go `text/template`. A user able to run DDL could put template actions in, for example, a table comment, and make Vitess run arbitrary SQL as the DBA user on the destination primaries ([GHSA-7g75-v57j-2ghw](https://github.com/vitessio/vitess/security/advisories/GHSA-7g75-v57j-2ghw)). The same pattern existed when a Reshard migrates the keyspace's other workflows (each stream's filter, which can contain table names, was executed as a template to fill in the key range) and in the legacy `vtctl` materializer (`MoveTables`, `Materialize`, `Migrate`, `CreateLookupVindex`). VDiff's `--debug-query` used the diffed query's `FROM` clause as a format string, so a `%` in a table name crashed vttablet. Placeholders are now substituted literally, and nothing else in the text is interpreted.
> - The legacy `vtctl` `Materialize` no longer substitutes a `{{.keyrange}}` or `{{.dbname}}` written in a source expression. This was never documented, and `vtctldclient Materialize` never supported it.

## 重大な修正 (3)

### CRLF 時の ZooKeeper 認証ファイルの ID 照合を修正

- 影響対象: CRLF 改行の ZooKeeper 認証ファイル、特に `digest` 認証ファイル

CRLF 改行では末尾の CR が取り除かれるため、生成される ID は `zkCli.sh` の `addauth digest <user>:<password>` と一致します。

> With `--topo-zk-auth-file` set, `zk2topo` authenticated its ZooKeeper session but still created every znode, lock and election nodes included, with a `world:anyone` ACL, so any client that could reach the ensemble could read, change or delete the topology ([GHSA-9c2c-hxwj-c5jr](https://github.com/vitessio/vitess/security/advisories/GHSA-9c2c-hxwj-c5jr)). Znodes are now created with ZooKeeper's `auth` ACL scheme, so only the auth file's identity can access them. A missing, unreadable or malformed auth file, or a failed `AddAuth`, now fails the connection instead of continuing unauthenticated. A `digest` auth file must hold both a user and a password, and a trailing CR is dropped like a trailing LF. `vtctldclient`, `topo2topo` and the `zk` tool now take the `--topo-zk-*` flags, and `vttestserver` passes `--topo-zk-auth-file` and the `--topo-zk-tls-*` flags on to `vtcombo`. Without an auth file, nothing changes.

### VDiff `--debug-query` の書式文字列によるクラッシュの修正

- 影響対象: 名前に `%` を含むテーブルでの VDiff `--debug-query`

行の不一致や余分な行により、ターゲットのプライマリ上の `vttablet` がクラッシュしたり、旧 VDiff がパニックを起こしたりすることがありました。差分対象クエリの `FROM` 句は、書式文字列として扱わず、そのまま出力するようになりました。

> `CopySchemaShard`, which `Reshard` also runs for each new shard unless `--skip-schema-copy` is set, filled the `{{.DatabaseName}}` placeholder by executing each copied `SHOW CREATE` statement as a Go `text/template`. A user able to run DDL could put template actions in, for example, a table comment, and make Vitess run arbitrary SQL as the DBA user on the destination primaries ([GHSA-7g75-v57j-2ghw](https://github.com/vitessio/vitess/security/advisories/GHSA-7g75-v57j-2ghw)). The same pattern existed when a Reshard migrates the keyspace's other workflows (each stream's filter, which can contain table names, was executed as a template to fill in the key range) and in the legacy `vtctl` materializer (`MoveTables`, `Materialize`, `Migrate`, `CreateLookupVindex`). VDiff's `--debug-query` used the diffed query's `FROM` clause as a format string, so a `%` in a table name crashed vttablet. Placeholders are now substituted literally, and nothing else in the text is interpreted.

### 不正な `COM_STMT_RESET` 後もVTGateが接続を維持

- 影響対象: VTGate の MySQL プロトコル接続

不正な `COM_STMT_RESET` パケットや不明なステートメント IDを受け取ると、以前はスタックトレースがログに記録され、接続が閉じられていました。現在はクライアントにエラーが1つ返され、接続は維持されます。エラーメッセージの内容は変わる場合がありますが、エラーコードと SQL state は変わりません。

> - Fixes [GHSA-g6c2-qp3p-x2w2](https://github.com/vitessio/vitess/security/advisories/GHSA-g6c2-qp3p-x2w2): the VTGate MySQL server kept reading a client's packet after returning its buffer to the shared buffer pool, where another connection could overwrite it. The auth switch response checked during login, the arguments of the replication commands, and the error replies to some malformed commands could use bytes from another connection's packet. See [#22247](https://github.com/vitessio/vitess/pull/22247).

## 機能・改善 (1)

- ZooKeeper フラグ対応とトポロジーツールの ACL 整合 (利用条件: ZooKeeper ACL の動作に必要な `--topo-zk-auth-file` の設定)

## その他の変更 (1)

- VTGate の未知パケットログでパケットのバイト列を省略

---

整理した内容は AI が作成するため誤っている可能性があり、無保証で提供されます。
