Conversation
PR Summary by QodoAdd PowerShell 7.6.3 bundle with Nerd Font auto-setup and safer launcher flags Description
Diagram
High-Level Assessment
Files changed (13)
|
Code Review by Qodo
1. Unpinned dependency downloads
|
| oh_my_posh = https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-windows-amd64.exe | ||
| oh_my_posh_theme = https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/paradox.omp.json | ||
|
|
||
| # Cascadia Mono Nerd Font - Nerd Font required for Oh My Posh glyphs/icons in the terminal | ||
| # font_name - must be the windows system name for the font | ||
| oh_my_posh_font_name = "CaskaydiaMono NF" | ||
|
|
||
| # Terminal-Icons - PowerShell module for colorful file/folder icons | ||
| # Automatically downloads the latest version from PowerShell Gallery during build | ||
| terminal_icons = https://www.powershellgallery.com/api/v2/package/Terminal-Icons | ||
|
|
||
| # PSReadLine - Enhanced command-line editing with syntax highlighting, predictive IntelliSense, and history search | ||
| # Provides advanced editing features like multi-line editing, undo/redo, and customizable key bindings | ||
| # Automatically updated to the latest version from PowerShell Gallery during build process | ||
| # Note: PowerShell 7+ includes PSReadLine by default, but this ensures the latest version with newest features | ||
| psreadline = https://www.powershellgallery.com/api/v2/package/PSReadLine |
There was a problem hiding this comment.
1. Unpinned dependency downloads 🐞 Bug ⛨ Security
The 7.6.3 deps use moving targets (GitHub releases/latest, PowerShell Gallery unversioned package endpoints, and a theme from main), and the build downloads them without any integrity verification; the profile then executes oh-my-posh init output via Invoke-Expression, turning any upstream change/compromise into startup-time code execution. This also makes builds non-reproducible because the same versioned bundle can contain different binaries over time.
Agent Prompt
### Issue description
`bin/powershell7.6.3/deps.properties` references moving URLs (e.g., GitHub `releases/latest`, PowerShell Gallery `.../package/<Name>`, and a theme from the `main` branch). `build.gradle` downloads these artifacts with `downloadFile()` but does not verify hashes/signatures, and `Microsoft.PowerShell_profile.ps1` executes oh-my-posh init output via `Invoke-Expression`, amplifying any upstream compromise into code execution at shell startup.
### Issue Context
This is both a reproducibility problem (different artifacts for the same bundle version) and a supply-chain risk (remote executable/modules fetched at build time without integrity checks).
### Fix Focus Areas
- bin/powershell7.6.3/deps.properties[1-16]
- build.gradle[659-689]
- build.gradle[888-943]
- build.gradle[165-206]
- bin/powershell7.6.3/config/Microsoft.PowerShell_profile.ps1[18-24]
### Suggested remediation
- Replace moving URLs with version-pinned URLs:
- Oh My Posh: use a specific tag URL (like the 7.5.4 approach) instead of `releases/latest`.
- Theme: pin to a specific commit/tag (avoid `main`), or vendor the theme into the repo/build inputs.
- PowerShell Gallery modules: use versioned package URLs (`.../package/Terminal-Icons/<version>`, `.../package/PSReadLine/<version>`).
- Add integrity verification in `build.gradle`:
- Extend `deps.properties` with SHA256 (or similar) fields per artifact and have `downloadFile()` verify the hash before copying/using.
- (Optional hardening) If feasible, reduce reliance on `Invoke-Expression` by using oh-my-posh’s recommended safer initialization pattern, or at minimum only run it when the binary/theme hash matches expected values.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 9e4acd1 |
No description provided.