Skip to content

fix(extensions): reject Windows drive and stream paths in archives - #1066

Merged
Xoshbin merged 1 commit into
Xoshbin:mainfrom
YsielX:fix/extension-archive-path-confinement
Nov 17, 2026
Merged

Xoshbin merged 1 commit into
Xoshbin:mainfrom
YsielX:fix/extension-archive-path-confinement

Conversation

@YsielX

@YsielX YsielX commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Before (issue / current behavior): Extension ZIP extraction rejected .. but accepted Windows drive-qualified filenames. Joining an absolute drive path discarded the extraction root, allowing an extension archive to write outside its destination. NTFS alternate data stream names were also accepted.
  • After (fix / new behavior): Reject colon-bearing archive entry names before creating their output path, on every platform. This blocks drive-absolute, drive-relative and alternate-stream paths while preserving ordinary relative paths, normalized backslashes and the existing leading-slash behavior.

The regression uses disposable temporary directories. It failed on the original Windows implementation with archive wrote outside its destination, and passes with the fix. It covers both slash forms, a leading slash before a drive path, drive-relative paths, nested drive syntax and alternate streams.

Affected areas

  • Launcher UI / UX (visuals, interactions, keyboard shortcuts, settings)
  • SDK / Extensions (asyar-sdk, extension runtime, IPC contracts, manifest)
  • Rust Backend / Platform (Tauri commands, search, storage, OS integration)
  • Docs / Tooling / Other (docs, CI, build scripts, locales)

Manual smoke test & Validation

  • I manually smoke-tested this in the running app (pnpm dev) and visually verified the fix/feature works.

  • Rechecked on Windows (2026-11-17): cargo test --workspace --locked extensions::installer::tests — 37 tests; observed the new regression fail before the fix.

  • Passed: cargo fmt --check, design-system check, and launcher type check (0 errors, 15 existing warnings).

  • Full cargo test --workspace --locked: 3,845 passed, 6 failed, 13 ignored in the launcher library. Failures are outside the changed installer: three agent runner tests, an application icon test, a sync/network test, and a runtime connect-timeout test. The run stops at that failing target.

  • pnpm check:ci stops on checkout-wide Prettier/line-ending issues. Workspace frontend tests cannot start with this machine's Node 20.11.1 (ERR_REQUIRE_ESM in Vitest/std-env).

  • Clippy with -D warnings reports existing Windows unused imports/results and application-service warnings. Rustdoc with -D warnings fails on the private enable_shutdown_privilege link in system_actions/windows.rs.

  • Manual in-app smoke testing has not been completed.

AI usage

  • AI tools helped produce this change.
  • I ran the asyar-contribution skill (.agents/skills/asyar-contribution/SKILL.md), followed it, and reviewed every generated line.

Codex implemented and reviewed the diff. Human maintainer review is still required.

Boundaries

  • Zero-hardcoded-strings i18n policy respected (if UI strings were added/changed).
  • Third-party extension compatibility preserved (no breaking changes to published extension contracts without deprecation/boundary adapter).
  • Hot paths remain fast and unblocked (window reveal, keystroke search, and 120 FPS UI responsiveness).
  • pnpm check:ci (or the relevant inner-loop checks) passes locally.

No UI, SDK API or IPC wire shapes change. Only unsafe archive filenames are rejected; full-matrix limitations are recorded above.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Archive extraction now rejects normalized entry paths containing : before constructing destination paths. Tests cover Windows absolute-path variants on Windows and drive-qualified or alternate-data-stream syntax across hosts.

Changes

Archive Path Validation

Layer / File(s) Summary
Reject colon-containing paths
asyar-launcher/src-tauri/src/extensions/installer.rs
extract_zip returns a validation error when a normalized entry path contains :. Tests verify rejection for drive-qualified and alternate-data-stream syntax and confirm the tested target is not written.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: xoshbin

Merge Risk: Minimal · up to 87297

Archive extraction now rejects entry names with colons, which blocks Windows drive paths and alternate-stream names. Ordinary relative paths are unaffected. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: extract_zip in the extensions installer now rejects archive entry paths containing a colon, which blocks Windows drive-qualified paths and NTFS alternate data streams.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: extract_zip in the extensions installer now rejects archive entry paths containing a colon, which blocks Windows drive-qualified paths and NTFS alternate data streams. The 'fix(extensions)' prefix identifies the area. The title is specific and matches the raw summary and PR objectives.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Xoshbin/asyar
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: b3de5a5
  • Layers: Repository YAML
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: cac414b4-048a-4c81-9682-2b85883d321e
Commits

Reviewing files that changed from the base of the PR and between b3de5a5 and 8729795.

Files selected for processing: 1

  • asyar-launcher/src-tauri/src/extensions/installer.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@Xoshbin
Xoshbin merged commit 85a03af into Xoshbin:main Nov 17, 2026
11 of 13 checks passed
@Xoshbin

Xoshbin commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Thanks you very much @YsielX!

I've merged it into main. Really appreciate you helping keep Asyar safe and secure for our Windows users!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants