Skip to content

Fix leak code via netstream ID enumeration - #3737

Open
James159758 wants to merge 1 commit into
wiremod:masterfrom
James159758:fix/netstream-recipient-check
Open

James159758 wants to merge 1 commit into
wiremod:masterfrom
James159758:fix/netstream-recipient-check

Conversation

@James159758

@James159758 James159758 commented Oct 19, 2026 •

Copy link
Copy Markdown

A client can enumerate the sequential stream IDs (1-1024) through NetStreamWrite and download another player's active stream without receiving its header. This exposes E2 source code and other private payloads.

Bind each stream to the recipients of its original message and reject requests from everyone else before sending chunks or invoking completion callbacks. The change is confined to netstream.lua and preserves the existing API and wire format.

@James159758 James159758 changed the title Restrict netstream downloads to message recipients Fix leak code via netstream ID enumeration Oct 19, 2026
Comment thread lua/autorun/netstream.lua
end
end

for _, name in ipairs({"Send", "Broadcast", "SendOmit", "SendPVS", "SendPAS"}) do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detouring every single net function is not a fix for this??

@Grocel

Grocel commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

looks sus

@blueshank-gh

blueshank-gh commented Oct 19, 2026 •

Copy link
Copy Markdown

Yes, lets detour every net function to solve an issue which occurrence can only happen once in a blue moon.
Claude ogus bogus pocus 5.5 really churning out the free agents isn't it?

dog-sus

@thegrb93

thegrb93 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

The issue is net.WriteStream is not given info about the recipients so there's no way for it to know who should get the data. A better solution would be to update the WriteStream api to take recipients. If no recipient specified then current behavior is used, otherwise the stream becomes protected and able to be delete when completed.

@blueshank-gh

Copy link
Copy Markdown

Honestly if need be, I think it would be better in the long run to like rewrite or use a different net streaming system at this point, of course this means a heavy refactor if that route is every looked into, but the pay-off would be way better I think than building on top of the current net stream system, which has been used pretty much everywhere, so you also have to battle that dependency across different addons anyways.

@thegrb93

Copy link
Copy Markdown
Contributor

The update I mentioned would work without breaking anything, so idk why you suggest rewriting it, lol.

@thegrb93

Copy link
Copy Markdown
Contributor

I can write the update sometime today.

@blueshank-gh

blueshank-gh commented Oct 19, 2026 •

Copy link
Copy Markdown

The update I mentioned would work without breaking anything, so idk why you suggest rewriting it, lol.

so you also have to battle that dependency across different addons anyways.
if another addon has their own netstream.lua, which many do, it will be likely overwritten, and the functions changed as well.
so at that point, to prevent that and not fight with other addons using the same or outdated versions, might be best to have your own.

  • well you could also just localize it to scripts n whatever, idk

@thegrb93

thegrb93 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Yeah sadly all the addons will need the update (I think just wire/starfall/pac3 use it at least). Too bad gmod devs never addressed the need for a file sending protocol. Oh well.

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.

5 participants