Skip to content

Fix shell escaping issues - #1341

Open
Marcel Laverdet (laverdet) wants to merge 1 commit into
devcontainers:mainfrom
laverdet:fix-shell-escape
Open

Marcel Laverdet (laverdet) wants to merge 1 commit into
devcontainers:mainfrom
laverdet:fix-shell-escape

Conversation

@laverdet

Copy link
Copy Markdown

Maybe some of these values are considered "safe" already (container username, so on) but it sets a bad precedent to escape in some places and not others. Quote escaping is not a matter of safe vs unsafe (since escaping may be nested, i.e. if you had JSON in an environment variable), it is a matter of correct vs incorrect. Safety is the byproduct of that.

Also note that I didn't do a full end to end test of this or setup a full fledged devcontainer distribution for development. The changes are straightforward so I'm shooting from the hip.


Note that this is not a comprehensive audit of this project. I've only looked at this one file.

Fixes #1324

Note that this is not a comprehensive audit of this project. I've only
looked at this one file.

Fixes devcontainers#1324
@laverdet
Marcel Laverdet (laverdet) requested a review from a team as a code owner October 27, 2026 12:08
@laverdet

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@laverdet

Copy link
Copy Markdown
Author

Oh yeah also please note that this would be a breaking change for users who expect $VARIABLES to be expanded on the container side. On the other hand, the existing behavior is plainly broken and potentially a security issue. Feature developers who want the value expanded can easily pass this off to eval if they feel like it in order to get expansion.

This branch has not been deployed

No deployments
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.

Feature option values are changed before install.sh sees them: quotes are stripped, and $… is expanded or executed

1 participant