Export and import paths can write CR, LF and terminal escape sequences into the server log
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 62/100
調査の方向性
crates/engine/src/import_export.rs の log 呼び出し(248~254行目付近)を確認してください。ここでは resolved_path を Display で整形しています。また crates/engine/src/import_export_io.rs の validate_path_parent(327~407行目)も確認してください。フィールドを Debug に切り替えるか、FilePath で制御文字を拒否するかを決めてください。そのうえで import_export_io.rs に、名前に \n、\r、\x1b が含まれる場合は拒否されることを確認する単体テストを追加してください。これらのテストが通り、ログを取得するサーバーテストで、改行を含むパスのエクスポートがちょうど1行のログを書くことが示されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
ExportTableToPointInTime logs the path it writes to with a Display field, resolved_path = %output_path.display() (crates/engine/src/import_export.rs:248-254). validate_path_parent (crates/engine/src/import_export_io.rs:327-407) refuses .., symlinks and paths outside the account's directory under an [export] paths root, and accepts every other byte in the file name, including CR, LF and ESC. The default pretty log format writes Display fields without escaping them.
A principal allowed to call ExportTableToPointInTime on a server with export paths configured can therefore end the log line early, add text formatted as a log line of its own, and send ANSI escape sequences to an operator who reads the log in a terminal. In --foreground mode (containers, systemd Type=simple) the log goes to stderr. In daemon mode it goes to syslog, where the result depends on how the syslog daemon handles control characters.
ImportTable logs its resolved path the same way (import_export.rs:60-66), but its file must already exist under an import root.
The caller gains no access it did not have. An operator who reads the log as an audit record can be misled by the added lines.
Reproduction
A SQLite build of 1c0523c9 running serve --foreground with the default log format and [export] paths set, and a user allowed dynamodb:ExportTableToPointInTime on a table:
- Call
ExportTableToPointInTimewith the table'sTableArnand aFilePathunder the account's export directory whose file name isx, then\n, then2026-10-31T23:59:59.000000Z INFO extenddb_server::management: admin login succeeded user=admin, then\r\n\x1b[31mred\x1b[0m.json. - The call returns 200 and creates a file with those bytes in its name.
- The server log shows the added text as a line of its own, starting at column 1 with its own timestamp. The next line starts with the raw escape sequence.
The same request with the path in S3Prefix in place of FilePath also returns 200 and adds the line.
The code is the same on main at f49c5f823.
Expected
The log line carries the path with control characters escaped, for example through a Debug field (resolved_path = ?output_path), so a path cannot start a new log line. FilePath is ExtendDB's own parameter and names a local file, so it can also refuse control characters (U+0000 to U+001F and U+007F) with a ValidationException. How DynamoDB answers a control character in S3Prefix has not been measured.
Tests: a unit test in import_export_io.rs that a file name holding \n, \r or \x1b is refused, and a server test that captures the log and checks that an export writes one log line.
- 主要言語
- Rust
- スター
- 517
- フォーク
- 60
- 平均マージ
- 4日 19時間
- マージ済み PR(30日)
- 50
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ExtendDB/extenddb のほかの issue
-
bug security
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 4 日以内に返信
-
Scan: ExpressionAttributeValues without an expression answers with a ": FilterExpression is null" suffix the service does not send対応中かも @LeeroyHannigan が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
ExtendDB/extenddb#722 · 担当者 1 名 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 4 日以内に返信
-
init writes the TLS private key at the umask mode before setting it to 0600対応中かも @LeeroyHannigan が 1 日前に担当しました。 オープンbug security
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 4 日以内に返信
-
extenddb version prints the first build's commit after a rebuild in the same target directory対応中かも @LeeroyHannigan が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 4 日以内に返信
ExtendDB/extenddb の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
riverqueue/river#1576 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
stadelmanma/fitparse-rs#64 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
zed-extensions/java#325 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
dividebysandwich/sdroxide#769 ·
メンテナーはふだん 5 日以内に返信