Repository navigation
[Aikido] Prevent command injection in replace_version Makefile target - #740
Closed
aikido-autofix[bot] wants to merge 1 commit into
Closed
aikido-autofix[bot] wants to merge 1 commit into
aikido-autofix[bot] wants to merge 1 commit into
Conversation
…n target with version...
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.
This patch addresses a command injection vulnerability in the
replace_versionMakefile target by implementing strict semantic versioning validation before executing shell commands. The fix adds a regex pattern check to ensure the version parameter matches the expected format (e.g., 1.2.3, 1.2.3-alpha.1) and rejects any malformed input that could be exploited for command injection. The Makefile has been updated to validate user input and provide clear error messages when invalid version formats are supplied.✅ 1 issue fixed by this PR
make replace_versionas a command-line Make variable. Make later expands that value directly into thepoetry version $(version)recipe. A tag such asdev-v1.0.0;commandtherefore produces a recipe equivalent topoetry version 1.0.0;command, and the shell executes the injected command. Git ref syntax permits semicolons, while the workflow's tag filters do not enforce a package-version grammar. The same issue exists in the production release workflow. Code executed in this job can alter checked-out source or build inputs before artifacts are constructed and published, enabling a repository writer with matching-tag permissions to publish attacker-controlled package contents through the configured package-publishing path.