-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Server-provided client-side scripting #5393
Comments
We are thinking about it but it's a very very low priority, the more important is to have pure client features at this moments, mod store, etc |
The server should keep server-side validation in either case since an attacker could ignore the mod and send digs anyway if they make a modified version of Minetest. For protection, the client-side mod would be just for prediction. |
This is true. However, being able to inject the clientmod would still be very useful. One could also make it harder to avoid using a clientmod by forcing the client to provide a list of mods to the server. Though the client could be modified to provide a bad list, it makes things a bit harder. |
I do not understand why this is considered low priority. Is this not the exact reason for having client-side mods in the first place? The ability to inject code into the client isn't even really a big thing -- I mean, websites do it to your browser all the time. If Minetest servers cannot do the same thing to Minetest clients despite supposedly being able to support it, then a huge opportunity for enhanced content delivery is lost. Minetest might as well not have client-side mods at all, if this important feature is left out. Edit (need to clarify something -- and I've probably been too harsh): The chief problem I see with supporting client-side mods, but not letting the server upload the mod code dynamically, is that this would require all players who want a given client-side mod to download it manually, and hope its communication channel/version is compatible with its counterpart mod that runs on the server. But in my experience, mod code frequently changes. I think it would be better if the client got a fresh version from the server every time, so that the user doesn't have to worry about versioning, compatibility, etc., and server operators who also manage all their own mod code can update their mods without having to ask their players to download a new version. |
@BluebirdGreycoat before making server sending code, you don't think we need API calls to run code ? |
@nerzhul I understand there are huge complexities (esp. security) that need to be overcome before this can even be possible. However, I have difficulty understanding (going just by the title of this issue) why this would be considered as anything other than the end goal of the effort toward client-side mods. |
I think this is very important. It's in line with Minetest 0.4's original goal of server-defined games. |
I agree that this is very important. For me, server mods being able to make GUIs better is the best thing about csm Maybe we do need to add new client functions first, but it shouldn't be "very very low priority" just a more medium/long term goal |
for GUI better, personnaly please justify which feature you need exactly, because we already send formspec to client and it sends events to server, in 99% cases it's normal because you need to handle server side things |
@nerzhul An example for the first thing: I want to make a mod where players can design their own spells, which are defined as some kind of tree of spell shapes and spell effects. Players can fit these together graphically similar to programming in Scratch. For example, an "area of effect" spell shape node would have slots for spell effects. An example for the second thing: Same example as the first, but assuming I don't have custom GUI elements so I use some system other than drag-and-drop. I don't want to have to wait for a roundtrip to the server between every click if there is 200ms+ latency. I can send the server the completed spell once the player decides to save it, because there's no need to validate the intermediate steps as long as the finished product, which is what will actually affect the world, is validated. In the same line of examples, it would also allow the player to save spells for use on any server with the mod. The server would just have to validate the spells when imported from the client. |
Creative GUI, for once, is slow on heavy servers. And I'm sure creative wouldn't be the only server mod that could benefit from injecting client-side GUI. That's not counting things like preventing showing the "undo lag" from protection mods (yes, you still need the server check, but this would reduce traffic and be much more usable). Honestly, most of the good uses of client-side scripting involve server mod dependencies. |
I'm removing the "low priority" label because as people listed, it's not low priority. However, just because this is not low priority, it doesn't mean that other things don't need to go in first. |
Phew! Sorry about the dupe. Thanks for this issue, can't wait until this is possible. Here's what I wrote: Right now we have Server-Side Mods (SSM), mod channels, and Client-Side Mods (CSM). However, in order for this to be entirely practical for the server's needs, it must know that the client has connected with the appropriate CSM loaded. I suggest a setting,
|
Aren't these two comments contradicting each other? |
http://irc.minetest.net/minetest-hub/2017-10-04#i_5097521 |
@ClobberXD wait for 5.0.0 to be released and we can discuss that feature together if you want to code it, and define a proper exchange format, with the correct unittests |
Been waiting for a long time, but I understand. I can continue waiting, no problem... :) |
nerzhul wrote:
Ok, but a 0.4.x client won't work on a 5.0.0 server, so only a 5.0.0 client can be used, which would not have the CSM code. I'm comparing the complete removal of CSM before or after 5.0.0 release, if it was removed afterwards in 5.1.0 then a 5.0.0 client could easily be used by anyone, without hacking, to continue using CSM. This is rather theoretical now anyway because it looks more likely CSM will be completed. But a while back it looked possible all CSM was going to be removed. If that was going to happen it would be best to do it before 5.0.0 not after. |
what scenario i want:
|
I started #8002 technical discussion about this need for the next roadmap. |
Just a quick update. Client-Provided CSM was released and usable in MT 0.4.16, so Server-Sent CSM is now just over 3 years overdue. I am counting the years =) Therefore i think that it is wrong that CPCSM is usable before SSCSM is implemented, CSM should be disabled until then. As i have commented elsewhere, although i am not particularly sure about this, i somewhat feel it would be best for MT to give up on CSM soon and remove it completely. Due to the inevitable problems of SSCSM, the workload, the security concerns, combined with the perpetual lack of core dev time. I know my opinion will be unpopular with many, but sometimes the right thing to do is an unpopular thing. |
I actually agree. Keeping this weird half-arsed non-solution is clearly the worst of all possible worlds. Kill it. I won't miss it. |
I think you both are trolling and should stop. Removing CSM is a massive
affair.
…On Tue, Jun 16, 2020, 8:07 PM Wuzzy ***@***.***> wrote:
I actually agree. Keeping this weird half-arsed non-solution is clearly
the worst of all possible worlds. Kill it. I won't miss it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5393 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFS4UYXPSUCLZXWAUKOVZADRXACLPANCNFSM4DDQUP7Q>
.
|
|
Plain CSMs (non-server-sent) also have their uses as utilitarian mods. Chat colouring, chat notification bell, etc. |
totally, also please note one coredev is complaining about it for 3 years, but he can try to implement it ? :) |
Good idea. |
Here is my current SRCSM (the R stands for required) proposal: https://gist.github.com/appgurueu/4f419f4b4c10dc850cc4049962cb101a. My plan notably deliberately argues for the exclusion of process sandboxing for the first version of SRCSM, both to avoid some of the limitations that brings and to make it more realistic that SRCSM happen in a reasonable timeframe. |
Other proposal (SSCSMCPB only (a much cooler abbreviation)): https://gist.github.com/Desour/0fe4f4586b9213c40db6b04b6e0bd899 Btw, linking this PR: #15246 |
(glossary: SSCSM = "server-sent" CSM = SPCSM = the thing we're talking about here responding to @appgurueu's proposal:
I think not taking an absolutist stance on security is reasonable but "oh you need to trust the game authors" would not be. I want to be able to join a random server without fearing that something could get access to my private data. (You don't seem to disagree)
This is a totally unnecessary dependency (and SPOF) on the server list.
How does this even work if other mods run in a different Lua env?
I think the crucial point is that SSMs are installed voluntarily, while the initial design of SSCSM foresaw that they are automatically downloaded and executed on the client just like a browser does. That raises some questions:
Sorry but no. "Nobody is seriously trying to attack us" cannot be part of your threat model.
Me neither. To pull up the browser analogy again, modern malware often relies on ads to either directly run JS or lead the user to a site they didn't mean to go to. Nothing even close exists in the Luanti ecosystem.
Note: point about SSMs somewhat addressed above. Without a process sandbox the attack surface being the Lua interpreter / JIT as well as (rightly pointed out) all the API-facing Luanti code, which includes various memory management which we have and still do get wrong.
This is not wrong but given modern mitigations attack in the style of "load this malicious file and we pwn you via a buffer overflow" are almost extinct.
Aside from introducing a huge amount of complexity on many fronts, which problem specifically is this supposed to solve?
Except the client does not automatically uninstall mods when they disappear from CDB.
I think you are overestimating the impact. Also: consider that if IPC is good enough for browsers to sandbox their web processes, then it will be good for enough us.
This is obviously correct, but what exactly are we expecting to support? A CSM re-calculating pathfinding for 50 entities every client step? I don't think so.
Cheating is only a concern if we blindly add trusted APIs to the current state of client-controlled CSM. |
If unsandboxed code is ever executed by the client, I suggest a security warning/popup for every instance. Could be either an itemized list of things to allow each time, or a separated popup per. Must be opt-in. If a user chooses to not opt in, I suppose that should be up to the SSMs to handle, but default behavior could be to kick. |
Also following current IRC discussions¹ it very much looks like the "we can relax the security stance on lua" instead brings in a whole lot of complexity regarding how to implement CSM revocation in a secure, privacy-preserving, auditable way without an always-online requirement. ¹: https://irc.minetest.net/minetest/2024-12-16 and https://irc.minetest.net/minetest/2024-12-17 |
Here's a start: #15568 |
A lot of good points here. I may write a more elaborate reply later on. I ran some basic benchmarks ( I may try to give feedback on the specific implementations over the holidays, I'll see. I appreciate the work you're doing @Desour. |
Not sure if this was discussed but it would be good if the client could allow/refuse CSMs sent by the server based on their license. Servers that would attempt sending a CSM not verified by CDB should provide a license identifier for the CSM, then the client could pick to reject CSMs under licenses that don't comply with the definitions of free/open source software by the FSF and OSI. |
The title says it all. What are the issues with doing this? Would security be an issue?
I would see allowing server-side mods to inject temporary client-side mods as being very useful, e.g. allowing a protection mod to make things more smooth for players. If the protection mod client-side portion were to be manually installed by the user, they could modify it so that they could get around protection requiring the protection mod to have to keep server side validation. Instead, if the server could inject the client side mod at load, this wouldn't be an issue.
The text was updated successfully, but these errors were encountered: