Skip to content

Quote user supplied inputs provided to scripts to avoid RCE#39644

Merged
jentfoo merged 3 commits intomasterfrom
jent/script_param_rce_fix
Mar 26, 2024
Merged

Quote user supplied inputs provided to scripts to avoid RCE#39644
jentfoo merged 3 commits intomasterfrom
jent/script_param_rce_fix

Conversation

@jentfoo
Copy link
Copy Markdown
Contributor

@jentfoo jentfoo commented Mar 20, 2024

This change introduces the func utils.UnixShellQuote which will quote any inputs which could potentially allow execution or script escape. This is utilized for http endpoints which produce scripts, as it's currently possible for a malicious actor to create links which can result in code execution on the victim running the resulting script.

fixes https://github.com/gravitational/security-findings/issues/77
fixes https://github.com/gravitational/security-findings/issues/86

changelog: Fix for possible phishing links which could result in code execution with install and join scripts

@github-actions
Copy link
Copy Markdown
Contributor

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Comment thread lib/web/integrations_awsoidc.go Outdated
Comment thread lib/web/join_tokens.go Outdated
Comment thread lib/web/apiserver.go Outdated
jentfoo added 3 commits March 25, 2024 16:07
This change introduces the func `utils.UnixShellQuote` which will quote any inputs which could potentially allow execution or script escape.
This is utilized to ensure that scripts produced from a potential Phishing link could not contain code execution which may expose a user.
…rameters are extracted

This will increase safety moving forward, but it requires a more conservative quoting strategy.
@jentfoo jentfoo force-pushed the jent/script_param_rce_fix branch from 2cb2697 to 6b49943 Compare March 25, 2024 23:06
@jentfoo jentfoo added this pull request to the merge queue Mar 26, 2024
Merged via the queue into master with commit b099293 Mar 26, 2024
@jentfoo jentfoo deleted the jent/script_param_rce_fix branch March 26, 2024 15:04
@public-teleport-github-review-bot
Copy link
Copy Markdown

@jentfoo See the table below for backport results.

Branch Result
branch/v13 Failed
branch/v14 Failed
branch/v15 Create PR

jentfoo added a commit that referenced this pull request Mar 26, 2024
* Quote user supplied inputs provided to scripts to avoid RCE

This change introduces the func `utils.UnixShellQuote` which will quote any inputs which could potentially allow execution or script escape.
This is utilized to ensure that scripts produced from a potential Phishing link could not contain code execution which may expose a user.

* awsAccessGraphOIDCSync: Ensure role parameter is quoted correctly

* join_tokens: Move shell quote to `getJoinScript` rather than where parameters are extracted

This will increase safety moving forward, but it requires a more conservative quoting strategy.
jentfoo added a commit that referenced this pull request Mar 26, 2024
* Quote user supplied inputs provided to scripts to avoid RCE

This change introduces the func `utils.UnixShellQuote` which will quote any inputs which could potentially allow execution or script escape.
This is utilized to ensure that scripts produced from a potential Phishing link could not contain code execution which may expose a user.

* awsAccessGraphOIDCSync: Ensure role parameter is quoted correctly

* join_tokens: Move shell quote to `getJoinScript` rather than where parameters are extracted

This will increase safety moving forward, but it requires a more conservative quoting strategy.
github-merge-queue Bot pushed a commit that referenced this pull request Mar 26, 2024
…39839)

* Quote user supplied inputs provided to scripts to avoid RCE

This change introduces the func `utils.UnixShellQuote` which will quote any inputs which could potentially allow execution or script escape.
This is utilized to ensure that scripts produced from a potential Phishing link could not contain code execution which may expose a user.

* awsAccessGraphOIDCSync: Ensure role parameter is quoted correctly

* join_tokens: Move shell quote to `getJoinScript` rather than where parameters are extracted

This will increase safety moving forward, but it requires a more conservative quoting strategy.
github-merge-queue Bot pushed a commit that referenced this pull request Mar 26, 2024
…39838)

* Quote user supplied inputs provided to scripts to avoid RCE

This change introduces the func `utils.UnixShellQuote` which will quote any inputs which could potentially allow execution or script escape.
This is utilized to ensure that scripts produced from a potential Phishing link could not contain code execution which may expose a user.

* awsAccessGraphOIDCSync: Ensure role parameter is quoted correctly

* join_tokens: Move shell quote to `getJoinScript` rather than where parameters are extracted

This will increase safety moving forward, but it requires a more conservative quoting strategy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants