fix(extensions): manifest id is not validated and is used as a path with recursive delete (path traversal)
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
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ả
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.
- 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
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.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QueryaHub/Querya-Desktop
-
enhancement ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QueryaHub/Querya-Desktop#1689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowĐang mởbug frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
QueryaHub/Querya-Desktop#1642 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug error-handling settings
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
QueryaHub/Querya-Desktop#1637 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
QueryaHub/Querya-Desktop#1636 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement marketplace
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QueryaHub/Querya-Desktop#1635 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của QueryaHub/Querya-Desktop
Issue tương tự
-
good-first-issue P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
flutter/dart-intellij-third-party#758 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: Incorrect location coordinates on logged Sound Meter dataCó thể đã có người làm @Jashan32 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/archive bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
DarkFlippers/qUnleashed#374 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:in-progress agent:ready feature P2 · 中 区域: 悬浮窗
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
ASDW51/DanmuFloat#178 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Missing workoutsĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
InlitX/GymMane#237 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày