fix(extensions): manifest id is not validated and is used as a path with recursive delete (path traversal)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
調査の方向性
Read lib/core/extensions/models/extension_manifest.dart and the install paths in lib/core/extensions/local_extension_installer.dart; then inspect HttpMarketplaceRepository.install and uninstall for the corresponding path checks. Add the manifest ID validation and containment checks described in the issue, including the listed invalid IDs. Done means both installer paths reject traversal and the unit tests cover those IDs.
索引モデルが issue の本文から書いたものです。
説明
Problem
ExtensionManifest.fromJson reads the id as json['id'] as String with no validation (lib/core/extensions/models/extension_manifest.dart:114). The id is then used as a path segment:
LocalExtensionInstaller.installFromArchive:Directory(p.join(root.path, manifest.id)), and if it exists,extDir.delete(recursive: true)(lib/core/extensions/local_extension_installer.dart:123-128).HttpMarketplaceRepository.installanduninstall(extensionId):p.join(dir.path, manifest.id)/p.join(dir.path, extensionId),delete(recursive: true)in uninstall.
A sideloaded .qext with "id": "../../some/dir" makes the installer recursively delete a directory outside the extensions folder (and write the extracted files there). isArchiveEntryNameSafe only checks entry names inside the archive, not the manifest id.
Expected
- Validate the id in
ExtensionManifest.fromJson(e.g.^[A-Za-z0-9][A-Za-z0-9._-]*$, no separators, no..) and reject the manifest otherwise. - After
p.join, checkisArchiveExtractPathWithinRoot(root, extDir.path)before delete / create, in both installers and inuninstall. - Unit tests: ids
../x,a/b,..\x, absolute path, empty.
- 主要言語
- Dart
- スター
- 23
- フォーク
- 1
- 平均マージ
- 31分
- マージ済み PR(30日)
- 570
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QueryaHub/Querya-Desktop のほかの issue
-
enhancement ui
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
QueryaHub/Querya-Desktop#1689 ·
メンテナーはふだん 1 日以内に返信
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowオープンbug frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
QueryaHub/Querya-Desktop#1642 ·
メンテナーはふだん 1 日以内に返信
-
bug error-handling settings
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
QueryaHub/Querya-Desktop#1637 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
QueryaHub/Querya-Desktop#1636 ·
メンテナーはふだん 1 日以内に返信
-
enhancement marketplace
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
QueryaHub/Querya-Desktop#1635 ·
メンテナーはふだん 1 日以内に返信
QueryaHub/Querya-Desktop の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
chriskelly/wish-together#36 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Paste asks for iOS paste permission because the default context menu ignores SystemContextMenu対応中かも @dorklein が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
maheshj01/searchfield#267 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
jhomlala/betterplayer#1616 ·
メンテナーはふだん 1 日以内に返信