Skip to content

Harden copy, scan, feedback and updates after security review - #41

Merged
vortexopenclaw merged 5 commits into
mainfrom
fix/security-review-2026-11
Nov 20, 2026
Merged

vortexopenclaw merged 5 commits into
mainfrom
fix/security-review-2026-11

Conversation

@vortexopenclaw

Copy link
Copy Markdown
Owner

Summary

A security review by Claude Mythos (offline, isolated sandbox), followed by verification and further fixes on macOS. There is no remote compromise. The most serious issues were in the native copy path: a hostile or failing card could crash the app, leave a truncated file under its final name, write onto the card, or follow links off the card. All 12 confirmed issues are fixed, plus the review's unconfirmed leads wherever a safe fix existed.

Fixed

Native app

  • Copy I/O errors no longer abort the app and leave partial files.
  • Sources are opened without following links and must be regular files.
  • Destinations are created exclusively and never written through a link.
  • A destination inside the source is refused.
  • Settings preservation copies regular files only.
  • Fixed-name metadata reads are bounded and don't follow links.
  • Merged GoPro exports are published atomically.
  • Copies are fsynced before verification.
  • Scan enumeration is capped at 500k entries.
  • Overflow-safe size totals; clamped multicam conversions.
  • 70mai timestamp parsing works (it never matched before).
  • "Show in Finder" reveals the folder instead of opening it.
  • Card names render verbatim.
  • Feedback refuses redirects and uses no cookies.
  • The update hash is streamed.

Electron: copy-time re-validation of every source (link swap, pipe, containment), exclusive create, Windows cross-drive containment, Windows reserved names.

Feedback Worker: IPv6 /64 rate limiting, field shape checks, hemisphere-tagged coordinates in basenames, null entries, browser-origin posts.

Updates Worker: malformed URL encoding.

Tests (macOS arm64, Xcode)

  • swift build; swift run DashcamOffloader --verify: all passes (19 PASS lines, 0 FAIL), including new hostile-card, 70mai and size checks.
  • Mutation check: undoing each core copy/read fix (no-follow source, regular-file check, exclusive destination create, no-follow metadata read) makes --verify fail.
  • desktop npm test: 22/22. Feedback Worker: 36 pass, 6 skipped (need a native snapshot, as before). Updates Worker: 7/7.
  • New JS tests fail on main: desktop hostile-card 7/11 fail, feedback hardening 5/6 fail, updates hardening 1/2 fail.
  • scripts/privacy-audit.sh passed.
  • CI now runs all feedback and updates Worker tests.

Behaviour changes

  • A download folder inside the scanned card or folder is refused.
  • Feedback extension counts bucket odd extensions as [other].
  • Basenames such as 40.71N_74.00W.mp4 are no longer retained in private evidence.
  • Browser-originated posts to /feedback get 403 unless ALLOWED_ORIGINS allows them.

Not changed

  • Updater freeze attack: the signed manifest has no expiry, so whoever controls the update host could hold users on an older, still-newer signed release. Fixing this needs a signed timestamp in the release-signing pipeline. Downgrades are already impossible.
  • Short-word extensions (e.g. .smith) and words in owner-chosen basenames can't be distinguished from technical tokens. This is documented in the Worker README.
  • AVFoundation/Vision parse media in-process. Moving that out of process is a larger change.

Workers need redeploying after merge.

Native app (Swift):
- Copy: read/write with throwing FileHandle APIs so I/O errors fail one item
  and remove the partial file instead of aborting the app.
- Copy: open sources O_NOFOLLOW|O_NONBLOCK and require a regular file; create
  destinations O_CREAT|O_EXCL|O_NOFOLLOW; re-check destination containment.
- Refuse a download folder inside the source card/folder.
- Settings preservation plans regular files only.
- Fixed-name metadata reads (SafeFileRead) don't follow links and are bounded.
- Merged GoPro exports write to a hidden temporary file and are published
  with link(2), so an interrupted export never sits under the final name.
- fsync copies before verification; verification reads bypass the cache.
- Cap scan enumeration at 500,000 entries (matches Electron).
- Saturating byte totals; clamped frame/size conversions in multicam export.
- Fix 70mai YYYYMMDD-HHMMSS parsing (never matched the 8+6 form, skipped the
  year in the six-field form).
- Reveal sources with selectFile instead of NSWorkspace.open; render card
  names with Text(verbatim:); feedback uses an ephemeral session that refuses
  redirects; stream the update archive hash.

Electron: copy re-validates each source at copy time (no-follow, regular
file, inode match, containment), exclusive destination create, Windows drive
containment fix, Windows reserved names and trailing dots.

Feedback Worker: IPv6 /64 rate-limit buckets, stricter field shapes,
hemisphere-tagged coordinates rejected in basenames (shared fixture with the
app), null entries dropped, browser-originated posts refused.
Updates Worker: malformed percent-encoding returns 404.

Tests: HostileCardVerification, 70mai timestamp and size-sum checks in
--verify; desktop hostile-card and Windows-name tests; Worker hardening tests,
now run in CI. Docs updated to match retention of opt-in private basenames.

Privacy impact: narrows what is sent (extension keys, field shapes,
coordinate-like basenames); nothing new is collected.
…undici

- scripts/ingest-submitted-scans.py: same hemisphere-tagged coordinate rule as
  the app and Worker, so the shared basename fixture agrees across all three.
- desktop: electron 43.7.8 -> 43.8.12 (certificate mitigation advisory) and
  undici patch updates via npm audit fix; npm audit --audit-level=high clean.
… names in test

safeRelativePath split only on path.sep, so on Windows '../x.mp4' was one
component that basename() happened to flatten. Split on both separators so
traversal is refused explicitly. The hostile-name test skips names Windows
cannot create.
@vortexopenclaw
vortexopenclaw merged commit ba1a6fd into main Nov 20, 2026
9 checks passed
@vortexopenclaw
vortexopenclaw deleted the fix/security-review-2026-11 branch November 20, 2026 01:56
vortexopenclaw added a commit that referenced this pull request Nov 20, 2026
* Harden copy, scan, feedback and updates after security review

Native app (Swift):
- Copy: read/write with throwing FileHandle APIs so I/O errors fail one item
  and remove the partial file instead of aborting the app.
- Copy: open sources O_NOFOLLOW|O_NONBLOCK and require a regular file; create
  destinations O_CREAT|O_EXCL|O_NOFOLLOW; re-check destination containment.
- Refuse a download folder inside the source card/folder.
- Settings preservation plans regular files only.
- Fixed-name metadata reads (SafeFileRead) don't follow links and are bounded.
- Merged GoPro exports write to a hidden temporary file and are published
  with link(2), so an interrupted export never sits under the final name.
- fsync copies before verification; verification reads bypass the cache.
- Cap scan enumeration at 500,000 entries (matches Electron).
- Saturating byte totals; clamped frame/size conversions in multicam export.
- Fix 70mai YYYYMMDD-HHMMSS parsing (never matched the 8+6 form, skipped the
  year in the six-field form).
- Reveal sources with selectFile instead of NSWorkspace.open; render card
  names with Text(verbatim:); feedback uses an ephemeral session that refuses
  redirects; stream the update archive hash.

Electron: copy re-validates each source at copy time (no-follow, regular
file, inode match, containment), exclusive destination create, Windows drive
containment fix, Windows reserved names and trailing dots.

Feedback Worker: IPv6 /64 rate-limit buckets, stricter field shapes,
hemisphere-tagged coordinates rejected in basenames (shared fixture with the
app), null entries dropped, browser-originated posts refused.
Updates Worker: malformed percent-encoding returns 404.

Tests: HostileCardVerification, 70mai timestamp and size-sum checks in
--verify; desktop hostile-card and Windows-name tests; Worker hardening tests,
now run in CI. Docs updated to match retention of opt-in private basenames.

Privacy impact: narrows what is sent (extension keys, field shapes,
coordinate-like basenames); nothing new is collected.

* Apply coordinate basename rule to ingest script; update Electron and undici

- scripts/ingest-submitted-scans.py: same hemisphere-tagged coordinate rule as
  the app and Worker, so the shared basename fixture agrees across all three.
- desktop: electron 43.7.8 -> 43.8.12 (certificate mitigation advisory) and
  undici patch updates via npm audit fix; npm audit --audit-level=high clean.

* Treat forward slashes as separators on Windows; Windows-valid hostile names in test

safeRelativePath split only on path.sep, so on Windows '../x.mp4' was one
component that basename() happened to flatten. Split on both separators so
traversal is refused explicitly. The hostile-name test skips names Windows
cannot create.

* Prepare 0.1.45 security hardening release

* Count expected hostile-name media explicitly so the Windows subset is correct

---------

Co-authored-by: Vortex Openclaw <274593135+vortexopenclaw@users.noreply.github.com>
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.

1 participant