r/StableDiffusion • u/mrinfo • Oct 16 '22
Update SECURITY WARNING: DO NOT USE --SHARE in Automatic1111 webui! Remote code execution exploit released 2 days ago, people are searching out gradio links
Exploit shared here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/2571 [RESOLVED]
Two examples of peoples Gradio sites being discovered by using share
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/513
If you are using --listen and on a public network you also might be at risk. However, the greatest risk is using --share. People are searching out these instances and there is a published exploit.
Colab is not immune
- Colab instances using are also not safe from javascript based browser attacks. I see some suggesting that it being in the cloud means the risk doesn't exist.
- Also linked Google Drive assets may be at risk
- While the remote code would happen within the colab, one must consider the attack could be javascript injection. If you wan't to learn what can be done via this method look into https://beefproject.com/
- /u/funciton also pointed out that if someone exploited your colab for malicious purposes, that you risk account suspension
The vulnerability still exists in the code as it is today, it has not been fixed (I noticed some assumed this)
Users reporting vulnerability (without proof of concept exploit)
23 days ago: https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/920
13 days ago: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/1576
Gradio will add more complexity to the urls provided
https://github.com/gradio-app/gradio/issues/2470 [RESOLVED]
Finally, consider advocating that the project adopt open source (currently is copyright and problematic) as it limits how many eyes will be on the code and willing to contribute to security and development
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/2059
Resolution
The exploit issue at github has been marked as resolved, and Gradio has reported that share URL's have been made more complex.
•
u/SandCheezy Oct 16 '22
Just to be clear everyone:
This only affects you if you added the “--share” parameter to your bat file. If you haven’t touched anything, you do not need to worry.
3
u/[deleted] Oct 16 '22
Also you run the risk of having your account suspended if malicious use is detected.
69
u/Evnl2020 Oct 16 '22
Yeah I've been saying from the start the public share links aren't safe as they are easily guessed/brute forced. In the early days of SD there were forks that had the public link on by default and/or obfuscated the link and settings so you could not disable it. (And one version with obfuscated settings had extremely questionably prompts and images in the logs folder)
20
u/Ill_Contribution6191 Oct 17 '22 edited Oct 17 '22
Hi everyone! I'm Abubakar (https://twitter.com/abidlabs), one of the developers of Gradio (www.gradio.dev), which is the UI library on which the Stable Diffusion WebUI is built.
Really appreciate the community bringing this issue to our attention. We've just pushed a fix that makes the share URLs be more complex, and it should automatically apply across all versions of Gradio or the WebUI that you are using (no need to update anything). If you try out share, please let us know if it works for you (or more importantly, if it doesn't work for you)
Given that our usage has significantly increased recently, we're going through and inspecting the entire Gradio stack for any security issues that may exist. We would appreciate any security vulnerabilities be reported to us at team@gradio.app
14
u/A_Dragon Oct 16 '22
What about —listen on a private network?
48
u/InterlocutorX Oct 16 '22
At a minimum use --gradio-auth username:password and put a password on it.
13
u/dimensionalApe Oct 16 '22
Being able to easily (just a cmd flag) publicly share over the internet (with an easily discoverable URL while at that, but it would still be almost as bad without that) a service that was never designed nor audited for security, was a catastrophe waiting to happen.
And gradio featuring a brutefoceable basic auth over plain HTTP only makes it worse by adding a false sense of security.
12
u/toastythunder Oct 16 '22
Do we need to do anything special to disable this? Is it enabled by default?
10
u/DimplyKitten824 Oct 16 '22
what do they do if they find an instance, and does having a username and password on it protect me?
8
u/derekleighstark Oct 16 '22
Yep, found this out when anime lollies started appearing in my generation folder... I don't even like anime. Freaked me out. Turned that off quick.
7
u/TiagoTiagoT Oct 16 '22
I don't plan on running it online any time soon, is there something I can block on my firewall and/or hosts file to ensure there won't be any unwanted connections even if somehow the share function gets accidentally activated or something?
7
u/KeenJelly Oct 16 '22
I use listen so I can access on my home network. Need to check if my router will let the traffic through.
7
u/AloisMusic Oct 16 '22
From what I understand, as long as the content of the folder "scripts" doesn't appear to have been modified, there hasn't been any RCE intrusion ? I guess the intruder could have erased the traces in the scripts folder afterwards.
Well that sucks.
I had a random guy generate some pictures on my PC one night I assume by looking for shares on gradio, I thought it was fun, but RCE is a much less fun prospect :(
5
u/Crowalho Oct 16 '22
This happened to me a couple of days ago, i noticed on the command line that there were generations being done even though i hadn't sent any work over, i went to check the output folder and there were a handfull of shrek and hulk generations. I thought someone had guessed the gradio link and disabled it hopefully that was all they did.
Edit: What makes me wonder is that i wasn't using the default port.
5
u/NextJS_ Oct 16 '22
I mean I suffered an attack for this like 1 month ago.
You can add user/password auth to gradio if you need to!
https://gradio.app/sharing_your_app/#authentication
demo.launch(auth=("admin", "pass1234"))8
u/ozzeruk82 Oct 16 '22
To try to rephrase the issue here. The problem with automatic’s version is that it allows you via the settings page to set the output destination of various files to wherever you want, which includes a folder where files are read and executed automatically when their script is executed on the UI. (This is the main issue)
Not the end of the world on your home PC, but if you are sharing to strangers with URLs that are unfortunately way too guess, then you may well get strangers trying to take advantage of this.
These are two unrelated problems that together are a much bigger problem.
Combining 1 with 2 is potentially enough to take over a Linux system if the instance was running as root. (It shouldn’t be).
7
u/itsB34STW4RS Oct 16 '22
This is exactly what I was talking about recently in a thread asking about sharing your local install with friends over the internet, nothing good will come of it.
3
u/[deleted] Oct 16 '22
Where in the code do I check to see if --listen or --share are enabled? Non-coder here.
3
u/psycholustmord Oct 16 '22
If you don’t share,it only listen to localhost
3
u/-becausereasons- Oct 16 '22
run with --gradio-auth option to set password
3
u/cmeerdog Oct 16 '22
i had a bunch of weeb sexy girl fanart bullshit that started showing up on my pc when using —share the other day. Cringe and annoying
2
u/cursorcube Oct 16 '22
I've been using --share to let a friend borrow my GPU for a bit just using a direct IP link, not through gradio. Is there any way to tell whether this has been exploited, like extra files in the scripts folder?
3
u/ninjasaid13 Oct 16 '22
my share has a username and password so you can't use it even with the right link.
4
u/1OO_percent_legit Oct 16 '22
Fuck, I loved using other peoples open gradio links, now people might secure them
2
u/C0rn3j Oct 16 '22
Aaand this is exactly the reason why you should containerize your services.
That way only your container gets owned and the rest of your system remains untouched.
On Linux with Nvidia, you can easily put SD in a container through LXD.
Here's an example setup with Arch Linux host and container on Nvidia - https://i.imgur.com/7vdG05x.png
1
u/mudman13 Oct 16 '22
Dam shame, I guess auto collab vertsion now unusable, had so many cool features, back to deforum i guess.
How do I add codeformer and ersgan?
1
u/scifivision Oct 17 '22 edited Oct 17 '22
I use share so I can access via my iPad but when I’m outside of the wifi it doesn’t work for me even with the password. Does that mean it’s ok/firewall is blocking? I think Xfinity blocks it to begin with?
I remember trying to unlock ports for opensim and had a hell of a time getting it to let people in on purpose
1
u/PristineGur3572 Sep 08 '23
This happened to me the other day so I'm gonna guess this isn't fixed. Loaded up and checked back and someone was diffusing. I was so mad. And apparently they have access to more than that when they connect.
1
u/Careful_View4064 Sep 09 '23
Just asking for confirmation, this exploit doesn't apply if you've set credentials via auth, yes?
Thanks for the warning otherwise.
1
u/TakenobuDate Sep 13 '23 edited Sep 13 '23
So..... is it safe to use "--share" now...? with password and username...?
1
u/PristineGur3572 Oct 06 '23
What about --gradio-auth someUsername:somePassword
1
u/grumpyfrench Oct 16 '22
And if you setup a password as well?
1
u/Sir-Main Oct 16 '22
is there a possibility to enable HTTPS? Having that enabled plus authentication would solve the problem
-10
u/sam__izdat Oct 16 '22 edited Oct 16 '22
I've never used this thing, but I do not understand why the hell it doesn't have a license, or why people are okay with that.
Until they decide whether this is free software or not, the default mode of operation for anyone reading or contributing any code should be that it's a toxic pile of shit, that you don't touch or go near, unless you want to run the risk of being embroiled IP legal confrontations. And this is a perfect example of the problem.
edit - Thanks, by the way. This thread, and the clueless morons making excuses and confidently spouting nonsense all over GH and reddit, have thoroughly convinced me to forego MIT licensing and release all my code related to SD under strong GPL, just to stay as far away from this absolute circus as possible.
0
u/ElMachoGrande Oct 16 '22
Should be safe enough if you are behind a firewall, shouldn't it. That should share on the local network only.
0
u/[deleted] Oct 16 '22
[deleted] — view deleted comment
1
u/[deleted] Oct 16 '22
[removed] — view removed comment
2
u/[deleted] Oct 19 '22 edited Sep 04 '25
[removed] — view removed comment
1
u/[deleted] Oct 16 '22
[removed] — view removed comment
0
u/[deleted] Oct 16 '22
[deleted] — view deleted comment