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

Add plugin CLI arguments support #1818

Merged
merged 2 commits into from
Apr 26, 2018
Merged

Conversation

celeron533
Copy link
Contributor

per #1672

image

@celeron533
Copy link
Contributor Author

celeron533 commented Apr 17, 2018

A simple way to test whether it is working or not:

  1. Type cmd as the plugin program
  2. Type anything as the plugin options. Such as pluginoptions
  3. Type /k echo %SS_LOCAL_HOST% %SS_LOCSL_PORT% %SS_REMOTE_HOST% %SS_REMOTE_PORT% %SS_PLUGIN_OPTIONS% > output.txt as the plugin arguments
  4. Save changes. It will call cmd.exe to write the environment variables to file output.txt, which may looks like:
127.0.0.1 5122 11.22.33.44 1234 pluginoptions

@chenshaoju
Copy link
Collaborator

I'm not sure, but this looks may have a security issue.
In extreme case, may cause the dangerous result like delete all files from the root or running script to download malware etc...

@celeron533
Copy link
Contributor Author

Advantages

User could use any plugin which does not follow the SIP003 standard. Currently only a limited number of SIP003 plugins available and some of them are out-of-date from their upstream release.

Disadvantages

As @chenshaoju mentioned,

this looks may have a security issue.

IMO, execute the plugin program already has a kind of risk.

@chenshaoju
Copy link
Collaborator

These environment variables only pass by cmd.exe (or shell?)

If use some 3rd non-SIP003 plugin, may not work.

Directly give these environment variables name to the plugin, Most is not working.
image

But if pass by cmd.exe, The cmd.exe will give environment variables value to the plugin, It's will work.
image

It's possible to start cmd.exe first, and give these environment variables to cmd.exe, Let cmd.ext give these value to the plugin?

Or just direct give these value to the plugin in the command line.

#1971

@ghost ghost mentioned this pull request Aug 19, 2018
5 tasks
celeron533 added a commit that referenced this pull request Aug 19, 2018
Cause: process's additional environment variables are not expanded
by correctly.
celeron533 added a commit to celeron533/shadowsocks-windows that referenced this pull request Aug 19, 2018
Cause: process's additional environment variables are not expanded
by correctly.

Innovated by studentmain (StudentEx <[email protected]>)
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