Skip to content

fix(progress): close four release blockers from the 1.14.2 security review; bump to 1.14.3 - #130

Closed
stevecastaneda wants to merge 6 commits into
mainfrom
fix-progress-review-blockers
Closed

stevecastaneda wants to merge 6 commits into
mainfrom
fix-progress-review-blockers

Conversation

@stevecastaneda

Copy link
Copy Markdown
Owner

Why

Every plugin change gets a security review against THREAT-MODEL.md before its PR. The review for #129 found four release blockers already in published Progress 1.14.2. Each was confirmed in the source. This is stacked on #129, which reformats every file. Merge #129 first, and GitHub will retarget this PR to main.

What changes

  1. Open on host opens only files whose default app shows them: images (not SVG), video, audio, PDF and plain text. It used to pass any file an agent recorded to open, xdg-open or explorer, so a .command, .bat or .app could run. The server checks the real file after links resolve, and the client offers Open only for the same files. Side effects: HTML always opens in the in-app page screen, folders no longer open in Finder or Explorer, and Office files copy their path.
  2. Agents can't install the launcher. The paseo_progress agent tool passed any command through, including install-launcher <path>, which writes an executable file anywhere, such as .git/hooks/pre-commit. The tool now refuses it. The user installs from the panel. Every other command writes only to Progress's own state folder or the run-history folder the user chose.
  3. A page handed files git ignores runs none of its own scripts. An ignored HTML page at the worktree root got ignored root files like .env inlined, then ran its scripts with no CSP. A CSP that still allows inline scripts isn't enough: in Chromium 156, a script could still send data by navigating its own frame or over WebRTC. So when an ignored file is inlined, the page gets script-src limited to the hash of Progress's own Escape script, and default-src 'none'. Pages with no ignored files inlined behave as before. Trade-off: a .scratch report with screenshots beside it shows with its scripts off.
  4. The Windows launcher names its Node. paseo-progress.cmd ran a bare node, which cmd.exe looks for in the agent's folder first. It now runs the absolute Node path, with ELECTRON_RUN_AS_NODE=1 when Paseo Desktop installed it. The script's lookup of paseo starts in Node's folder. Existing installs read as outdated once and reinstall from the panel.
  • Version 1.14.3, with four [Fixed] changelog entries.

Checks

  • Root format:check and lint pass. In progress/, typecheck, npm test (231 pass), check:install and the Linux run of check:windows pass. The new tests failed before the fix.
  • The real previewDeliverable output ran in Chromium: the ignored page that got .env made zero network requests. A tracked control page made every request.
  • npm run security-review: No release blockers found. Report at ~/.local/state/paseo-plugins/security-review/progress-1.14.3.md on steve-dev.

Not verified

  • Windows. progress-windows.yml runs the new .cmd and planted-file checks on this PR.
  • The CSP inside Paseo's Electron build. Chromium 156 was tested.

Pins oxfmt 0.77.0 in a private root package.json that only holds repo tooling, with printWidth 160. Every other change is the formatter's own output.
Pins oxlint 1.92.0 with the correctness and suspicious categories as errors, and fixes the code each finding pointed at without changing behavior.

Three config choices instead of code changes:
- no-control-regex is off in the five files whose regexes match control characters on purpose, to strip or refuse them.
- no-underscore-dangle allows _pty, node-pty's own field for the terminal device.
- In client and shared code, which Paseo runs on Hermes on phones, no-array-sort and no-array-reverse are off and toSorted/toReversed are banned instead: Hermes has no Array#toSorted.

One disable comment, in progress/client/pills.tsx: consistent-function-scoping doesn't count a component used as a JSX tag as a use of the scope it closes over.
…safe helpers

Each plugin that starts programs or changes files now does it through one module, server/system.ts, so the safe defaults live in one place per package:

- A program starts in the folder Node lives in unless the caller names a folder it has a reason for.
- A file change names a folder the caller trusts and a relative name inside it. The name can't climb out with `..`, and no folder between the two may be a link.

Call sites keep their behavior, with one exception in Progress: opening a file (explorer, xdg-open, open), reading the default browser (plutil) and asking Paseo where the plugin lives used to start in the daemon's own working folder, and now start in Node's folder like git already did. Windows looks in that folder for a program before PATH. system.test.ts covers it.

Pulse's programs.ts becomes its system.ts. Pulse's reporter, pulse-reporter.mjs, runs inside Playwright and can't import the helper, so it keeps its own writes. Shell Yeah's proc.ts stays the one file there that starts programs.
…tted files

no-restricted-imports bans node:child_process, and every fs and fs/promises function that writes, appends, renames, removes, links, changes modes or opens a file, along with the default and namespace imports that would reach them. They're allowed in each plugin's server/system.ts, Shell Yeah's proc.ts, Pulse's pulse-reporter.mjs, tests, and repo tooling. require, createRequire and process.getBuiltinModule are banned too, since each loads a module past the import rule.
…eview; bump to 1.14.3

- Open hands a file to the host's default app only when it is an image,
  video, audio, PDF or text file, checked on the real file. Scripts, apps,
  SVG, HTML and folders copy their path; HTML always opens in Paseo.
- The paseo_progress agent tool refuses install-launcher. It is the only
  command that writes outside Progress's state folder and the chosen
  run-history folder.
- A page given any file git ignores gets a Content-Security-Policy that
  blocks every load and every script except Progress's Escape handler.
  Measured in Chromium 156: with scripts allowed, a page can still send data
  by navigating its frame or over WebRTC, so its scripts stay off.
- paseo-progress.cmd runs the Node that installed it by full path, and the
  launcher asks Paseo from Node's folder instead of the agent's.
@stevecastaneda

Copy link
Copy Markdown
Owner Author

Replaced by the PR rebuilt on main after #129's squash merge, which also moves HTML reports to Paseo's own preview.

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