Skip to content

fix(personalize): handle script paths safely - #1042

Open
Edd88-pixel wants to merge 2 commits into
coder:mainfrom
Edd88-pixel:fix/personalize-safe-script-paths-712
Open

fix(personalize): handle script paths safely#1042
Edd88-pixel wants to merge 2 commits into
coder:mainfrom
Edd88-pixel:fix/personalize-safe-script-paths-712

Conversation

@Edd88-pixel

@Edd88-pixel Edd88-pixel commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Why

Personalize interpolated the configured script path directly into its rendered shell script and later used it without quoting. Paths containing spaces or shell metacharacters could therefore be split or expanded instead of being treated as literal paths.

This change addresses the Personalize portion of #712 while preserving the module's existing startup behavior.

Changes

  • encode the configured path in Terraform and decode it at the shell boundary
  • quote file checks and script execution while preserving ~ expansion and the user script's exit code
  • cover default configuration, custom paths, missing and non-executable scripts, successful execution, and failure propagation
  • document default and custom usage, idempotent startup behavior, and the module's runtime boundaries
  • keep the versioned Terraform example in the README overview as required by the repository validator
  • bump the documented module version from 1.0.32 to 1.0.33

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/personalize
New version: v1.0.33
Breaking change: [ ] Yes [x] No

Validation

  • terraform validate
  • terraform test — 2 passed, 0 failed
  • bun test registry/coder/modules/personalize/main.test.ts — 7 module-level end-to-end scenarios passed by rendering the coder_script with Terraform and executing it in Alpine
  • Prettier and terraform fmt -check
  • ShellCheck with warning severity
  • .github/scripts/version-bump.sh --ci patch origin/main
  • go build ./cmd/readmevalidation && ./readmevalidation — all Registry READMEs valid

Related Issues

Addresses the Personalize portion of #712.

@Edd88-pixel
Edd88-pixel marked this pull request as ready for review August 11, 2026 09:38
@Edd88-pixel

Copy link
Copy Markdown
Contributor Author

Hi @DevelopmentCats, could you please review this PR ? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant