mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 16:01:42 +00:00
6acce7a887
Module names parsed from user-supplied lock content (parse_modules_json)
and script imports (parse_script_imports) were interpolated directly into
PowerShell single-quoted string literals when building the module install
command, with no escaping or validation. A module name containing a single
quote could break out of the literal and execute arbitrary PowerShell.
Two-layer fix:
- Validate module names against ^[a-zA-Z0-9._-]+$. parse_modules_json
rejects invalid names with an error; parse_script_imports skips them
with a warning.
- Defense-in-depth: escape single quotes (' -> '') on both name and
version before interpolating into the install hashtable literals,
mirroring val_to_pwsh_param.
Fixes WIN-2049
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Windmill Worker
The worker. Used to process and execute flows & jobs.
This crate exposes both a library as well as a binary target.