Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fix(extensions): manifest id is not validated and is used as a path with recursive delete (path traversal)

オープン
#1,560 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
dart, flutter
領域
desktop, security

調査の方向性

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 の本文から書いたものです。

説明

bug core marketplace P1 stability

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.install and uninstall(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, check isArchiveExtractPathWithinRoot(root, extDir.path) before delete / create, in both installers and in uninstall.
  • Unit tests: ids ../x, a/b, ..\x, absolute path, empty.
主要言語
Dart
スター
23
フォーク
1
平均マージ
31分
マージ済み PR(30日)
570

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

QueryaHub/Querya-Desktop のほかの issue

QueryaHub/Querya-Desktop の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。