fix: security hardening for .claude/skills/release/skill.sh#108
Merged
muzahidul-opti merged 2 commits intomasterfrom May 4, 2026
Merged
fix: security hardening for .claude/skills/release/skill.sh#108muzahidul-opti merged 2 commits intomasterfrom
muzahidul-opti merged 2 commits intomasterfrom
Conversation
Agent-Logs-Url: https://github.com/optimizely/optimizely-flutter-sdk/sessions/13b89788-5c29-4b2f-addc-f2528768d844 Co-authored-by: muzahidul-opti <129880873+muzahidul-opti@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix security and correctness issues in skill.sh
fix: security hardening for .claude/skills/release/skill.sh
May 4, 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.
Eight shell scripting security and correctness bugs in the release skill script, ranging from sed delimiter injection to silent CI failures.
Summary
seddelimiter injection — switch/-delimited regex to\|...\|alternate delimiter; a version containing/would break the expression even after escaping\nnot interpolated in fallback release notes — replace double-quoted"...\n..."withprintfso newlines are actual newlines, not literal\nset +Hat top;!characters in CHANGELOG content could trigger bash history expansion in interactive shellstrapvariable scoping bug —trap "rm -f '$DRY_RUN_LOG'"with single quotes means$DRY_RUN_LOGis never expanded; fix totrap "rm -f \"${DRY_RUN_LOG}\""to expand at registration time[[ ! -t 0 ]]guard beforeread; non-interactive stdin (e.g./dev/nullin CI) would silently produce empty$REPLYwith no actionable error$REPLYin[[ ]]— quote the variable per bash best practicesif ! ... | teewith explicit${PIPESTATUS[0]}capture soflutterfailures are reliably detected regardless ofteeexit statusgh auth statusscope gap — add inline comment noting it only verifies authentication, not that the token holds thereposcope required to create releasesTest plan
Syntax validated with
bash -n. Logic changes verified by inspection against each issue description.Issues
Original prompt
Security Fixes for
.claude/skills/release/skill.shPlease fix the following security and correctness issues in
.claude/skills/release/skill.sh. The current file content is:Issues to fix (in priority order):
🔴 Critical
1.
seddelimiter injection via$ESCAPED_VERSIONThe escaped version is interpolated directly into a
/-delimited sed expression. A version containing/(even after escaping) breaks the delimiter. Fix by switching to\|...|alternate sed delimiter syntax:2.
\nnot interpreted in fallback release notes stringIn bash,
\ninside double-quoted strings is a literal backslash-n. Fix with$'...'ANSI-C quoting:🟠 High
3. Disable history expansion to prevent
!in CHANGELOG content from being expandedAdd
set +Hnear the top of the script (afterset -euo pipefail) to disable bash history expansion, which can be triggered by!characters in$CHANGELOG_CONTENTin interactive shells.4. Version validated after first use — move validation earlier
The version format regex check is on line 21, but
VERSIONhas already been referenced on line 18 ([[ "${2:-}" == "--prerelease" ]]is fine...This pull request was created from Copilot chat.