Skip to content

Commit

Permalink
Fix InstanceStream exploit
Browse files Browse the repository at this point in the history
  • Loading branch information
hoontee committed Nov 12, 2024
1 parent bf9f4e7 commit 8faab8b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
28 changes: 21 additions & 7 deletions Pronghorn/New.luau
Original file line number Diff line number Diff line change
Expand Up @@ -410,27 +410,41 @@ end
--- Creates and returns an InstanceStream.
--- @return InstanceStream -- The new InstanceStream.
function New.InstanceStream(): InstanceStream<...any>
local replicators: {[Player]: RemoteEvent} = {}

local actions: InstanceStream<...Instance> = {
Instances = {};

Start = function(self: InstanceStream<...Instance>, players: Player | {Player}, instances: {Instance}): string
if IS_CLIENT then error("InstanceStream.Start cannot be called on the client", 0) end

table.clear(self.Instances)
for index, instance in instances do
self.Instances[index] = instance
end

local uid = `{HttpService:GenerateGUID(false)}_{#instances}`

for _, player in (if type(players) == "table" then players else {players}) :: {Player} do
local container = New.Instance("RemoteEvent", `__instanceStream_{uid}`) :: RemoteEvent
if not player.Parent then continue end

for _, instance in instances do
table.insert(self.Instances, instance)
New.Instance("ObjectValue", container, {Value = instance})
local replicator = New.Instance("RemoteEvent", `__instanceStream_{uid}`) :: RemoteEvent

if replicators[player] then
replicators[player]:Destroy()
end
replicators[player] = replicator

container.Parent = player.PlayerGui
for _, instance in instances do
New.Instance("ObjectValue", replicator, {Value = instance})
end

container.OnServerEvent:Once(function()
container:Destroy()
replicator.OnServerEvent:Once(function()
replicator:Destroy()
replicators[player] = nil
end)

replicator.Parent = player.PlayerGui
end

return uid
Expand Down
2 changes: 1 addition & 1 deletion Pronghorn/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
║ ██████▀██▓▌▀▌ ▄ ▄▓▌▐▓█▌ ║
║ ║
║ ║
║ Pronghorn Framework Rev. B73
║ Pronghorn Framework Rev. B74
║ https://github.com/Iron-Stag-Games/Pronghorn ║
║ GNU Lesser General Public License v2.1 ║
║ ║
Expand Down

0 comments on commit 8faab8b

Please sign in to comment.