GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(extract): prevent symlink-follow truncation via FILE_FLAG_OPEN_REPARSE_POINT (#1116 follow-up) by ByGh00st · Pull Request #1195 · zip-rs/zip2

Conversation

@ByGh00st

@ByGh00st ByGh00st commented Oct 26, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Follow-up hardening for #1116 (prevent following symbolic links during file creation).

Problem

In create_outfile, options.create(true).write(true).truncate(true) is invoked to open and create the target file. While fs::remove_file safely clears pre-existing symlinks and fs::symlink_metadata audits the path afterwards, on Windows, if an entry at outpath is swapped for a symbolic link or reparse point during concurrent filesystem activity, options.open(outpath) follows the link by default and truncates the external target before the post-open audit executes. Additionally, the post-open check audited fs::symlink_metadata(outpath) rather than the open file handle itself.

Solution

  1. Prevent Reparse Point Traversal: Configured options.custom_flags(FILE_FLAG_OPEN_REPARSE_POINT) on Windows via windows_sys. This instructs CreateFileW to open the reparse point/symlink itself rather than following it across filesystem boundaries to external files.
  2. Handle-Based Metadata Audit: Audited file.metadata()?.file_type().is_symlink() directly on the opened file handle, ensuring the open file descriptor itself is validated against symbolic links and reparse points.

Verification

  • cargo clippy --lib -- -D warnings: CLEAN (0 warnings)
  • tests/extract_symlink.rs: All symlink security regression suites pass.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ByGh00st
fix(extract): prevent symlink-follow truncation via FILE_FLAG_OPEN_RE…
26f13e3
…PARSE_POINT
@github-actions github-actions Bot added the size: tiny label Oct 26, 2026
Pr0methean
Pr0methean approved these changes Oct 26, 2026
View reviewed changes
@Pr0methean
Pr0methean enabled auto-merge October 26, 2026 19:55
@Pr0methean
Pr0methean added this pull request to the merge queue Oct 26, 2026
Merged via the queue into zip-rs:master with commit fc470f5 Oct 26, 2026
135 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ByGh00st
ByGh00st deleted the fix/harden-outfile-reparse branch October 26, 2026 22:30
@Pr0methean Pr0methean mentioned this pull request Oct 27, 2026
chore: release v9.1.3 #1185
Merged
@Clovis500c Clovis500c mentioned this pull request Oct 30, 2026
fix(deps): tauri-plugin-updater 2.14.1, zip 4.6.1 → 9.1.3 (Dependabot alerts 2–4) legato-app/legato#11
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Pr0methean Pr0methean Pr0methean approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size: tiny

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ByGh00st @Pr0methean
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.