Conversation
- Updated package versions in CrossRepoActions.csproj for ktsu libraries and Microsoft packages. - Added support for central package management in Dotnet class, including methods to check for central management, update packages, and handle outdated dependencies. - Refactored UpdatePackages verb to accommodate both central and traditional package management approaches.
- Introduced comprehensive documentation outlining the features, installation instructions, usage examples, and command options for the CrossRepoActions .NET console application. - Highlighted core commands such as UpdatePackages, BuildAndTest, and GitPull, along with their functionalities. - Included prerequisites, configuration options, and dependencies to assist users in setting up and utilizing the application effectively.
There was a problem hiding this comment.
Bug: Git Class Vulnerable to Command Injection
The Git class methods using RunCommand.Execute are vulnerable to command injection and failures. Parameters such as commit messages, file paths, and repository paths are directly interpolated into the shell command string without proper quoting or escaping. This allows shell metacharacters (e.g., spaces, quotes, semicolons, pipes) to break commands or execute arbitrary code. This regression occurred when switching from PowerShell's safe parameter handling to direct string interpolation.
CrossRepoActions/Git.cs#L35-L81
CrossRepoActions/CrossRepoActions/Git.cs
Lines 35 to 81 in 5da8870
Bug: Path Quoting and Test Output Issues
Multiple dotnet commands executed via RunCommand.Execute use unquoted project or solution file paths in their command strings. This causes commands to fail if paths contain spaces, as RunCommand does not automatically handle quoting like the previous PowerShell implementation. Affected methods include BuildProject, GetProjects, GetSolutionDependencies, GetOutdatedProjectDependencies, UpdatePackagesTraditional, GetProjectAssemblyName, GetProjectVersion, IsProjectPackable, GetOutdatedCentralPackageDependencies, and GetOutdatedPackagesJson.
Additionally, the RunTests() method now incorrectly filters its output to only error messages by calling GetErrors(), which breaks downstream logic expecting full test output to parse pass/fail results.
CrossRepoActions/Dotnet.cs#L31-L173
CrossRepoActions/CrossRepoActions/Dotnet.cs
Lines 31 to 173 in 5da8870
Bug: Unquoted Paths and Names Cause Command Failures
The dotnet add command is constructed using unquoted string interpolation for the project file path and package name. This leads to command execution failures if paths or package names contain spaces, and introduces a command injection vulnerability if package names contain shell metacharacters.
CrossRepoActions/Dotnet.cs#L172-L173
CrossRepoActions/CrossRepoActions/Dotnet.cs
Lines 172 to 173 in 5da8870
Bug: Missing Flag Causes Incorrect Package Listing
The GetOutdatedProjectDependencies method is missing the --outdated flag in its dotnet list package command. This causes the method to return all packages for a project instead of only the outdated ones, contrary to its intended purpose.
CrossRepoActions/Dotnet.cs#L101-L102
CrossRepoActions/CrossRepoActions/Dotnet.cs
Lines 101 to 102 in 5da8870
Was this report helpful? Give feedback by reacting with 👍 or 👎
No description provided.