fix: replace execSync template string with execFileSync in sync-brand-to-tokens.cjs#283
Open
xiaolai wants to merge 1 commit intonextlevelbuilder:mainfrom
Open
fix: replace execSync template string with execFileSync in sync-brand-to-tokens.cjs#283xiaolai wants to merge 1 commit intonextlevelbuilder:mainfrom
xiaolai wants to merge 1 commit intonextlevelbuilder:mainfrom
Conversation
This was referenced Apr 26, 2026
execSync with a backtick template string creates a shell-expansion
surface. Although all three variables (generateScript, DESIGN_TOKENS_JSON,
DESIGN_TOKENS_CSS) are currently hardcoded constants, the pattern is
fragile — any future substitution of user-controlled data would create
shell injection.
Replace with execFileSync('node', [...args]) to eliminate the shell
entirely and make the boundary explicit.
Co-Authored-By: Claude Code <[email protected]>
0c7b24c to
d807abf
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.
Security Fix (Medium)
`.claude/skills/brand/scripts/sync-brand-to-tokens.cjs` line 253 uses `execSync` with a backtick template string:
```js
execSync(`node ${generateScript} --config ${DESIGN_TOKENS_JSON} -o ${DESIGN_TOKENS_CSS}`, { ... })
```
All three interpolated variables (`generateScript`, `DESIGN_TOKENS_JSON`, `DESIGN_TOKENS_CSS`) are currently hardcoded constants, so there is no active injection risk. However, the pattern is fragile: if any future change passes user-controlled data through one of those paths, a shell injection vulnerability would be introduced without any obvious signal.
Fix: Replace with `execFileSync('node', [generateScript, '--config', DESIGN_TOKENS_JSON, '-o', DESIGN_TOKENS_CSS], { ... })`. The array form never invokes a shell, so the expansion surface is eliminated entirely. Import updated from `execSync` to `execFileSync`.