Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,560 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
dart, flutter
Lĩnh vực
desktop, security

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Dart
Star
23
Fork
1
Merge trung bình
31 phút
Pull request đã merge (30 ngày)
570

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của QueryaHub/Querya-Desktop

Tất cả issue của QueryaHub/Querya-Desktop

Issue tương tự

Thêm issue về Dart

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.