Skip to content

docs(hopper): clarify lease directory recovery guidance - #1628

Merged
N0zoM1z0 merged 12 commits into
morluto:mainfrom
Sunil56224972:security/fix-3-critical-vulnerabilities
Oct 14, 2026
Merged

N0zoM1z0 merged 12 commits into
morluto:mainfrom
Sunil56224972:security/fix-3-critical-vulnerabilities

Conversation

@Sunil56224972

@Sunil56224972 Sunil56224972 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

The Hopper security implementation and its owning regressions from this PR are already present on main through 599a8ee11 (fix(process): preserve cleanup ownership and normalize captures once), which explicitly records #1628 among its reviewed fixes. Synchronizing this branch therefore leaves no duplicate production-code or test diff.

This final change resolves the remaining review finding in the owning installation guide. Recovery guidance now applies specifically when opening the Hopper lease directory fails with a permission error. Earlier creation failures, including an unsearchable parent, keep their separate diagnostic and are no longer covered by that promise.

The integrated behavior on main still provides the original outcome:

  • unsuccessful Hopper launches remove token-bearing bootstrap files, including cancellation paths;
  • the no-O_NOFOLLOW snapshot fallback verifies the named leaf, opened descriptor, final leaf identity, and caller cancellation;
  • Hopper lease permissions are changed and rechecked through the admitted directory descriptor;
  • production-boundary regressions cover bootstrap cleanup, snapshot fallback cancellation, lease admission, and descriptor replacement.

Validation on final head 3986dfc91:

  • focused owning-boundary selection: 27 passed, with four explicit native-Windows skips on Linux;
  • npm run check:fast: passed;
  • npm run docs:check: passed, including README consistency;
  • GitHub required CI: 7 passed, 21 correctly skipped for the docs-only net diff;
  • Greptile: passed; all review threads resolved.

Earlier real-provider verification used the official Hopper 6.4.2 demo on Ubuntu 24.04 against /usr/bin/true; public CLI analysis completed with the target digest unchanged and clean teardown. Native Windows and macOS execution of the original security paths was not independently rerun for this final docs-only head.

Original work by Sunil remains in the PR history. The follow-up review, implementation, reconciliation, and verification retain the requested Kaoru0822 co-author metadata.

…s, credential exposure)

1. CWE-367: TOCTOU Race in HopperTargetLease ensureLeaseDirectory
2. CWE-61: Silent O_NOFOLLOW Bypass on Windows in FilesystemSnapshot
3. CWE-312: Cleartext Auth Token in Bootstrap Script

Includes 12 PoC + regression tests (all green)
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

…s, credential exposure)

1. CWE-367: TOCTOU Race in HopperTargetLease ensureLeaseDirectory
2. CWE-61: Silent O_NOFOLLOW Bypass on Windows in FilesystemSnapshot
3. CWE-312: Cleartext Auth Token in Bootstrap Script

Includes 12 PoC + regression tests (all green)
@Sunil56224972 Sunil56224972 changed the title fix: Patch 3 Critical Security Vulnerabilities (TOCTOU, Symlink Bypass, Credential Exposure) fix: Defense-in-depth hardening for bootstrap cleanup, symlink handling, and lease directory validation Oct 10, 2026
…s, credential exposure)

1. CWE-367: TOCTOU Race in HopperTargetLease ensureLeaseDirectory
2. CWE-61: Silent O_NOFOLLOW Bypass on Windows in FilesystemSnapshot
3. CWE-312: Cleartext Auth Token in Bootstrap Script

Includes 12 PoC + regression tests (all green)
@Sunil56224972

Copy link
Copy Markdown
Contributor Author

CI Status Note

The CI checks are pending approval — this is expected for first-time fork PRs. GitHub requires maintainer approval to run workflows from external contributors.

What has been verified locally:

  • \oxlint\ (lint): ✅ pass
  • \oxfmt\ (format): ✅ pass
  • \ sc --noEmit\ (typecheck): ✅ pass
  • \�itest\ (tests): ✅ 11/11 pass (on Windows)
  • Existing \FilesystemSnapshot.test.ts: ✅ 4 passed, 1 skipped (no regressions)

All pre-push hooks (\lint-staged\ → \oxfmt\ + \oxlint, and \ urbo typecheck lint) passed successfully on each commit.

@morluto
morluto requested a review from N0zoM1z0 October 11, 2026 10:20

@dandgabr dandgabr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consolidated review

  • P3 — Normalize Windows paths before comparing with realpath. FilesystemSnapshot.hashFile (src/process/capture/FilesystemSnapshot.ts:99-112) omits a file whenever the requested path is textually different from realpath, even if no symlink or junction was traversed. filesystem_observation_paths are caller-provided and resolved against the working directory, but Windows path casing and other canonical-form differences can remain. A valid file is then omitted and coverage is reported as truncated. Compare Windows paths with platform-aware normalization while preserving detection of symlink and junction traversal.

No other actionable P0–P4 finding was confirmed.

@dandgabr dandgabr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional review finding

  • [P2] Remove the token-bearing bootstrap on every cancelled launch path. #writeBootstrap() creates the file before #launchPreparedTarget() starts. Several normal error returns inside its try bypass the cleanup catch, including an aborted signal or launchHopperProcess() returning null after cancellation. The bootstrap therefore remains in the session directory after a cancelled launch. Move cleanup to a finally/shared failure path or explicitly remove it before every non-success return.

The existing P3 Windows path-normalization finding remains in the earlier consolidated review.

…s, credential exposure)

1. CWE-367: TOCTOU Race in HopperTargetLease ensureLeaseDirectory
2. CWE-61: Silent O_NOFOLLOW Bypass on Windows in FilesystemSnapshot
3. CWE-312: Cleartext Auth Token in Bootstrap Script

Includes 12 PoC + regression tests (all green)
@Sunil56224972

Copy link
Copy Markdown
Contributor Author

Addressed review findings

Thanks @dandgabr for the precise review — both findings were valid. Pushed fixes in commit \

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] This documentation change appears safe to merge.

Summary

This PR narrows the Hopper lease recovery note to match the existing error message.

  • The guide ties Hopper lease recovery steps to permission errors when opening the directory.

Reviews (6) · Last reviewed commit: "chore: synchronize Hopper security fixes..." · Reviewed by Greptile

Comment thread src/hopper/SecurityRegression.test.ts Resolved
Comment thread src/hopper/HopperTargetLease.ts Resolved
Comment thread src/hopper/SecurityRegression.test.ts Resolved
morluto and others added 3 commits October 13, 2026 20:14
Check caller cancellation after the final fallback file inspection, preserving the original reason and closing the descriptor. Explain unreadable Hopper lease directory recovery while leaving unverified permissions unchanged.

Replace filesystem primitive self-tests with production lease admission and descriptor-swap regressions. Keep bootstrap cleanup and symlink omission with their owning boundaries. Include fallback cancellation in Windows and POSIX verification lanes.

Verified 160 related checks, four explicit native Windows skips, typecheck, scoped lint, module boundaries and docs. Real official Linux Hopper 6.4.2 demo CLI analysis passes as an ordinary Ubuntu 24.04 user with unchanged target bytes and clean teardown. Full lint has one unchanged Ghidra baseline error reproduced on exact main 928b4d5.

Co-authored-by: Kaoru0822 <[email protected]>
@morluto morluto added bug Something isn't working security Target-execution safety, isolation, authority, and contamination handling area: runtime Process capture and runtime observation area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: build Build, CI, packaging, and publishing P1: high High priority issue for current or next iteration labels Oct 13, 2026
Comment thread docs/installation.md Resolved
morluto added a commit that referenced this pull request Oct 14, 2026
Retain unresolved process identity and launch evidence through retryable cleanup. Share capture path normalization and preserve failed filesystem observations. Bound child output and drain Windows pipes without one-chunk throttling.

Reviewed fixes include #1628, #2632, #2644, #2784, #2928, #2931, #2965, #2992, and #3011.

Validation: 92 focused source tests passed; four platform-specific skips. Real Windows and Hopper lifecycle coverage was not rerun.
Co-authored-by: Kaoru0822 <[email protected]>

# Conflicts:
#	docs/installation.md
#	tests/process-global/hopperLeaseDescriptorPermissions.test.ts
@greptile-apps

greptile-apps Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@N0zoM1z0 N0zoM1z0 changed the title fix: Defense-in-depth hardening for bootstrap cleanup, symlink handling, and lease directory validation docs(hopper): clarify lease directory recovery guidance Oct 14, 2026
@N0zoM1z0
N0zoM1z0 merged commit d901561 into morluto:main Oct 14, 2026
29 checks passed
@morluto morluto added documentation Improvements or additions to documentation provider: hopper Analysis provider / engine: hopper labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: runtime Process capture and runtime observation bug Something isn't working documentation Improvements or additions to documentation P1: high High priority issue for current or next iteration provider: hopper Analysis provider / engine: hopper security Target-execution safety, isolation, authority, and contamination handling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants