post: run findmnt, df, and umount with argv arrays instead of shell strings - #79
Merged
Merged
Conversation
…trings Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
… 23.2.0 JSON.parse regression Node 23.2.0 ships a V8 regression (nodejs/node#55826) that makes webpack's ConcatenationScope.matchModuleReference throw "Unexpected end of JSON input" for some concatenated module graphs. Adding src/mount.ts to the post bundle produced such a graph, so `ncc build src/post.ts` failed in CI while the main bundle still built. Node 24 also matches the `node24` runtime declared in action.yml. Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
rcooney-sh
marked this pull request as ready for review
September 11, 2026 20:56
The Build job rebuilds dist/ and fails if it differs from what is committed, but reproducing that build locally needs BUF_TOKEN for the private @buf packages, which most contributors and automated fixers do not have. Upload the bundle CI just built so it can be downloaded and committed directly. Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
piob-io
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Security patch for vulnagent problem
prb_ef0452cf3a0d8e30(Medium, remediation groupstickydisk-shell-quoting): command injection in the post-step cleanup via thepathinput. Aikido finding 654097526, Linear SEC-747.The main step already quotes the path (
shellQuote), butsrc/post.tsreads it back from state and interpolated it into fiveexecshell strings inside double quotes, where$(...)and backticks still expand. The pentest usedpath: /$(id>&2).*and gotidoutput in the post-step log fromsudo umount "...".The fix removes the shell from every command that takes the path.
src/mount.tsrunsfindmnt,df, andumountthroughexecFilewith argv arrays, andpost.tscalls those helpers:The two
mount | greppipelines are gone: the mounted check and the device lookup collapse intofindMountedDevice, which asksfindmnt --mountpointand falls back to parsing themountlisting in-process with an exact target match. This is also stricter than before:mount | grep "/mnt/cache"treated/mnt/cache2as a hit and would attempt an unmount of a path that was never mounted. If nothing is mounted at the path the post step logs and returns as it did. Commands whose arguments come from the system (sync,drop_caches,blockdev --flushbufson the devicefindmntreported) are unchanged.No path validation or charset restriction was added: with argv execution the input is only ever a filename, and rejecting characters would break legitimate paths (spaces, unicode) for no security gain.
Tests:
src/__tests__/mount.test.tschecks a hostile path (/$(id>&2).*;\touch /tmp/pwned`|"x'y) reachesfindmnt,df, andumountas one argv element, checks themountlisting parser matches the target exactly, and on Linux runs the real binaries:dffails on the hostile path instead of expanding it, and succeeds onos.tmpdir()`.Draft because
dist/is not rebuilt. The build needs the private@bufregistry (BUF_TOKEN), which this environment does not have, so the Build workflow will fail until someone runsnpm ci && npm run buildon this branch and commitsdist/index.jsanddist/post/index.js. Onlydist/post/index.jsshould change materially;dist/index.jsis untouched by the source change.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled. (Staging)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.