Repository navigation
Conversation
Three gaps shared one script boundary: - powershellLiteral() only escaped the ASCII quote, but Windows PowerShell accepts U+2018-U+201B as single-quote delimiters; a typographic quote in a command, path, log path or environment value ended the literal early and reopened script parsing inside the -EncodedCommand script. - $env: names interpolated into the same script were not validated, so a name holding a quote or operator injected statements. - powershell.exe spawned by bare name lets CreateProcess search the current directory first; a planted binary would run in place of the OS copy. Resolve the executable under SystemRoot instead (both here and in the credential-store-local launcher). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
SanHsien
added a commit
to SanHsien/hypit
that referenced
this pull request
Oct 28, 2026
…graphic quotes Port of upstream PR hypit-ai#443 (issue hypit-ai#451, head 926502e); the diff does not apply here, and this fork's credential adapter lives in credential-store-os (upstream: credential-store-local). Three defects, all present in this fork: - powershellLiteral doubled only the ASCII quote; Windows PowerShell also ends a literal at U+2018-U+201B, so a typographic quote reopened parsing of the -EncodedCommand script. - $env: names went into that script unvalidated. - startWithOwnConsole and windowsCredential spawned `powershell.exe` by bare name, which CreateProcess resolves from the current directory first. Tests mock spawn/execFile, so none of them starts PowerShell; all failed on the behaviour before the fix and pass after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SanHsien
added a commit
to SanHsien/hypit
that referenced
this pull request
Oct 28, 2026
…i#447-hypit-ai#456; advance watermarks PRs hypit-ai#442, hypit-ai#443 and hypit-ai#444 were ported ahead of upstream (d5afdfe, 541ab59, 5dc763c) because the fork has the same defect and it is reachable from outside input. The rest are recorded with the fork-side evidence and a re-review trigger in docs/fork/DECISIONS.md. Release track unchanged at v0.3.1; watermarks PR 455, issue 456. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #451
Summary
Three findings sharing the Windows
-EncodedCommandlaunch path:powershellLiteralinpackages/runtime-local/src/programs.tsescaped only the ASCII quote by doubling it, but Windows PowerShell accepts U+2018–U+201B as single-quote delimiters too. A typographic quote in a program command, argument, working directory, log path or environment value ended the literal early and reopened script parsing — injected statements inside the encodedStart-Processscript. All five quote codepoints are now doubled (exported for the test, same convention aswindowsCommandLine).$env:${name}interpolated environment names into the script unvalidated, so a name holding a quote/operator injected statements. Names now must match^[A-Za-z_][A-Za-z0-9_]*$— every in-repo program declaration already conforms.startWithOwnConsole(programs.ts) andwindowsCredential(packages/credential-store-local/src/windows.ts) spawnedpowershell.exeby bare name;CreateProcesssearches the current directory first, so a plantedpowershell.exein the working directory runs in place of the OS copy — with the caller's arguments, including the credential operation. AwindowsPowerShell()helper now resolves the executable under%SystemRoot%\System32\WindowsPowerShell\v1.0\, falling back to the bare name only whenSystemRootis unset.Behavior relative to main
’x';evil;#'must be a portable variable namepowershell.exein CWDRed / green
packages/runtime-local/test/powershell-literal.test.ts(new): ASCII quote doubling preserved, and each of U+2018–U+201B doubles — on main they passed through unescaped.Verification
node --import tsx --test packages/runtime-local/test/powershell-literal.test.ts packages/runtime-local/test/windows-command-line.test.ts— pass.pnpm check— clean.Merge Danger
envnames outsideA-Za-z0-9_(after a leading letter/underscore) now throw a clear error instead of silently interpolating.SystemRootunset the launcher still falls back to PATH lookup, same as before.Checklist
Generated with Devin