fix: harden install-pi.sh and share.sh against supply-chain and data-exposure risks#45
Open
xiaolai wants to merge 1 commit intonicobailon:mainfrom
Open
fix: harden install-pi.sh and share.sh against supply-chain and data-exposure risks#45xiaolai wants to merge 1 commit intonicobailon:mainfrom
xiaolai wants to merge 1 commit intonicobailon:mainfrom
Conversation
This was referenced Apr 26, 2026
Two low/medium security improvements: 1. install-pi.sh sed delimiter (Low): The sed path-substitution used `|` as delimiter. If $HOME contained a `|` character, the expression would break silently. Switched to `#`, which cannot appear in a filesystem path, making the substitution safe on all systems. 2. share.sh public-deploy warning (Medium): The share script deployed the user's HTML to a public Vercel URL without any pre-deploy notice. Added an explicit warning line before the deployment call so users are aware the file will be publicly accessible before the action is taken. Co-Authored-By: Claude Code <noreply@anthropic.com>
881d1f2 to
42131e8
Compare
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.
What's fixed
Three targeted security improvements across two scripts. All are low-blast-radius changes (≤ 1–2 lines each).
1. Pin
git cloneto a tag —install-pi.shline 13 (Medium)Before:
git clone --depth 1 https://github.com/nicobailon/visual-explainer.git "$TEMP_DIR"After:
git clone --depth 1 --branch v0.6.3 https://github.com/nicobailon/visual-explainer.git "$TEMP_DIR"A supply-chain compromise of the upstream default branch would silently deliver malicious content to every user who runs
install-pi.sh. Pinning to a tagged release limits exposure to events where a signed tag itself is re-pointed — substantially harder to exploit undetected. Update the tag here whenever you cut a new release.2. Fix
seddelimiter —install-pi.shlines 28–30 (Low)Before:
sed -i "s|{{skill_dir}}|$SKILL_DIR|g"After:
sed -i "s#{{skill_dir}}#$SKILL_DIR#g"$SKILL_DIRis derived from$HOME. If$HOMEcontains a|character (unusual but valid on some systems), the sed expression breaks silently and the path substitution is skipped — leaving{{skill_dir}}unresolved in the installed skill files.#cannot appear in a POSIX filesystem path, making it unconditionally safe as a sed delimiter.3. Add pre-deploy public warning —
plugins/visual-explainer/scripts/share.shline 50 (Medium)Added before the Vercel deploy call:
The deployed HTML file is publicly accessible to anyone who obtains the URL. Users may not realise this when invoking
/share, particularly if the diagram contains internal architecture details or proprietary information. An explicit warning before the deploy call gives users the opportunity to cancel.