Skip to content

Check prop protection before sockets weld to plugs - #3761

Merged
Astralcircle merged 4 commits into
wiremod:masterfrom
TameTheGame:tamethegame/socket-weld-permission
Nov 15, 2026
Merged

Astralcircle merged 4 commits into
wiremod:masterfrom
TameTheGame:tamethegame/socket-weld-permission

Conversation

@TameTheGame

Copy link
Copy Markdown
Contributor

Sockets now check prop protection before they weld to a plug, so a player can't plug into someone else's socket and copy their whole build with AdvDupe2. This closes #2973.

The check goes in ENT:CanLink and uses WireLib.CanTool the same way the Wire Grabber does, so it works with whatever prop protection the server uses. The socket's owner has to be allowed to weld the plug, and the plug's owner has to be allowed to weld the socket. It's a server-side check since WireLib.CanTool only exists on the server. Data sockets are covered too since they use the same CanLink, and if a socket or plug has no owner (like one a map spawned), only the other owner is checked.

I tested it on a local dedicated server with FPP and two bots. Before the change, one bot's plug linked into the other bot's socket even though neither could touch the other's props. With this change, it only linked once both bots had added each other as buddies. A player's own socket and plug still link like before, and without a prop protection addon nothing changes. I used AI to assist but understand/reviewed the code myself.

TameTheGame and others added 3 commits November 12, 2026 07:37
A socket welded to any matching plug nearby without checking either owner's tool permission, so a player could weld their plug into someone else's socket and copy the build with AdvDupe2. CanLink now checks WireLib.CanTool both ways on the server.
Without the plug owner check, a player can add the socket's owner as a buddy and their plug still welds into that socket. WireLib.GetOwner and WireLib.CanTool only exist on the server, but CanLink also runs on the client for the helper line. A socket or plug with no owner only has the other side checked, so map-spawned sockets link again.
@TameTheGame

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look, @Astralcircle! I pushed a small follow-up on top of your commit that checks the plug's owner too since without it someone can add the socket's owner as a buddy and their plug still welds into that socket. It also returns early on the client, because WireLib.GetOwner and WireLib.CanTool are server-only and the helper line calls CanLink there. Sockets with no owner (like one a map spawns) link again as well. I tested it on a local server with FPP and two bots.

@Astralcircle
Astralcircle merged commit 86b509b into wiremod:master Nov 15, 2026
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.

Wire entities not checking permission before creating constraint lead to exploit with AdvDupe2

2 participants