Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update StoreFormFromPortal.cs - Issue #1331 Fix #1332

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

TaranYourAss
Copy link
Contributor

What is being changed

Adding check to make sure loaded URLs from a plugins 'Project Url" are actual URLs when a user clicks on the loaded 'Project Url' within the Tool Library page. With this change, any user that clicks on a plugin 'Project Url' that fails the Uri check, the Process.Start() function will not be called.

Found the code from: https://stackoverflow.com/questions/7578857/how-to-check-whether-a-string-is-a-valid-http-url

This will just prevent any non-urls from being executed in the Process.Start() function - preventing any potential for command injection found in Issue #1331.

How command injection occurs

Fundamentally command injection can occur when the 'Project Url' for a plugin contains commands instead of a URL and the user clicks on the 'Project Url' for a plugin in the Tool Library page. As the current version of XrmToolBox does not sanitize or check the URL from plugins loaded from the XrmToolBox portal, there are a few ways a malicious actor could utilize this flaw to execute arbitrary commands on users machines:

  1. A malicious plugin with commands stored in its 'Project Url' is successfully added to the XrmToolBox Portal and loaded into users Tool Library.
    image

  2. A man-in-the-middle attack occurs, intercepting the request to www.xrmtoolbox.com/_odata/plugins, and replacing specific or all mctools_projecturl data with arbitrary commands
    image

What loaded commands will look like from a man-in-the-middle attack:
image

adding check to make sure the loaded URL from plugins are actual URLs
@TaranYourAss
Copy link
Contributor Author

XrmToolBox-CommandInjectionDemo.mp4

@MscrmTools MscrmTools merged commit 729f81a into MscrmTools:master Jul 15, 2024
1 check passed
@MscrmTools
Copy link
Owner

Thank you! I'm adding your change

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.

2 participants