Security audit report
Lanternport Tycoon (fictional)
1 Summary
Lanternport Tycoon's server code is tidy and most remotes are handled well, but three problems would let any player with a free exploit tool damage the game straight away: buying items at a price they choose, duplicating items through trades, and killing anyone on the server from anywhere. All seven findings were fixed by the studio and confirmed closed in the retest.
- Critical 1
- High 2
- Medium 2
- Low 1
- Info 1
Fix these first
- LT-01 The shop trusts the price the client sends, so anyone can mint coins.
- LT-02 Accepting a trade twice in one frame duplicates the items.
- LT-03 The hit remote takes the target and the damage from the client.
After the fixes: all seven findings closed. 96 forged requests across all 14 remotes, 0 accepted, 0 server errors.
2 Scope and method
- In scope
- The main place and the trading hub place: 23 server scripts and modules, 14 RemoteEvents and RemoteFunctions, 2 DataStores.
- Version tested
- Build 0.9.4 for the review, 0.9.5 for the retest.
- Access
- Team Create access from the owner for reading the code, and a copy of the place for testing.
- Out of scope
- Roblox's own platform, third-party modules the studio doesn't control, and anything on live servers.
The code was reviewed first: every remote, what the server trusts from the client, and how coins and items move from one owner to another. Each suspected problem was then tested in Studio, on the copy of the place, with a test client sending forged requests: wrong types, negative and huge numbers, NaN and infinity, very long strings, and repeated or simultaneous calls.
What an audit never involves: exploiting the live game, touching real players or their data, or anything against Roblox's Terms of Use. Every test runs in Studio, with the access the owner gives.
3 How severity is rated
- Critical
- Anyone can do it with a free exploit tool, and it breaks the economy, wipes or steals data, or lets one player hurt everyone. Fix before anything else.
- High
- Serious abuse that takes some effort or timing: duplicating items, killing players unfairly, skipping paid content.
- Medium
- Abuse that's limited in reach or needs unusual conditions: rewards claimed twice, lag caused on purpose.
- Low
- Little direct harm: leaked information or cosmetic abuse that makes other attacks easier.
- Info
- Not a hole yet, but worth fixing: missing checks that cause errors, or code that will become a problem later.
4 Findings
The shop trusts the price the client sends
What's wrong
The client sends the item and its price, and the server charges whatever price arrives. A negative price passes the "can they afford it" check and adds coins instead of taking them.
Impact
Unlimited coins and every shop item for anyone who tries. The economy, the leaderboards and the paid coin packs all stop meaning anything.
Steps to reproduce
- On the copy of the place, start a Play test and switch the view to the client.
- In the command bar, run
game.ReplicatedStorage.Remotes.BuyItem:FireServer("GoldenLantern", -1000000). - The coin counter goes up by 1,000,000 and the Golden Lantern is in the inventory.
Fix
Remotes.BuyItem.OnServerEvent:Connect(function(player, itemId, price)
local data = Profiles[player]
if data.Coins >= price then
data.Coins -= price
Inventory.Give(player, itemId)
end
end)
-- prices come from the server's catalogue, never from the client
Remotes.BuyItem.OnServerEvent:Connect(function(player, itemId)
if type(itemId) ~= "string" then return end
local item = Catalogue[itemId]
local data = Profiles[player]
if not item or not item.ForSale or not data then return end
if data.Coins < item.Price then return end
data.Coins -= item.Price
Inventory.Give(player, itemId)
end)
Retest: the same call is ignored and the coins and inventory don't change. Unknown item ids, numbers and tables in place of an id are ignored too.
Accepting a trade twice in one frame duplicates the items
What's wrong
The handler checks that both players still own their items, then saves before moving anything. Saving yields, so a second accept that arrives in the same frame passes the same check before the first one has moved a thing, and both hand the items over.
Impact
Rare items can be copied as often as the pair likes. Trade values collapse, and items players paid Robux for lose their worth.
Steps to reproduce
- Start a local server with two players. Open a trade between them and press Ready on both sides.
- On Player1's client, run
for _ = 1, 2 do game.ReplicatedStorage.Remotes.AcceptTrade:FireServer(tradeId) end, with the id shown in the trade window. - Player2 now has Player1's item twice.
Fix
Remotes.AcceptTrade.OnServerEvent:Connect(function(player, tradeId)
local trade = Trades[tradeId]
if not trade or not trade.BothReady then return end
if Inventory.Has(trade.A, trade.OfferA) and Inventory.Has(trade.B, trade.OfferB) then
Inventory.Save(trade.A) -- yields: a second accept gets in here
Inventory.Give(trade.B, trade.OfferA)
Inventory.Give(trade.A, trade.OfferB)
Inventory.Take(trade.A, trade.OfferA)
Inventory.Take(trade.B, trade.OfferB)
Trades[tradeId] = nil
end
end)
Remotes.AcceptTrade.OnServerEvent:Connect(function(player, tradeId)
local trade = Trades[tradeId]
if not trade or not trade.BothReady then return end
if player ~= trade.A and player ~= trade.B then return end
-- claim the trade before anything can yield: a second accept stops here
Trades[tradeId] = nil
-- take from both sides first; nobody receives anything unless both takes worked
local tookA = Inventory.Take(trade.A, trade.OfferA)
local tookB = tookA and Inventory.Take(trade.B, trade.OfferB)
if not tookB then
if tookA then Inventory.Give(trade.A, trade.OfferA) end -- roll back
return
end
Inventory.Give(trade.A, trade.OfferB)
Inventory.Give(trade.B, trade.OfferA)
TradeLog.Write(tradeId, trade) -- one record per trade id
Each trade id can now complete once, and items leave their owner before they arrive anywhere else. The saves were already session-locked, so the same account can't trade the same item from two servers at once.
Retest: 200 double and triple accepts sent in the same frame. Every trade completed exactly once, and the item counts on both sides balanced.
The hit remote takes the target and the damage from the client
What's wrong
The client names who it hit and how hard, and the server applies it. There's no check on distance, walls, cooldown or the weapon in hand, and negative damage heals.
Impact
One player can kill everyone on the server instantly, from anywhere on the map, or make themselves impossible to kill.
Steps to reproduce
- Start a local server with two players and switch the view to Player1's client.
- In the command bar, run
for _, p in game.Players:GetPlayers() do game.ReplicatedStorage.Remotes.Hit:FireServer(p.Character, math.huge) end. - Player2 dies at once, from across the map.
Fix
Remotes.Hit.OnServerEvent:Connect(function(player, target, damage)
local humanoid = target and target:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid:TakeDamage(damage)
end
end)
Remotes.Hit.OnServerEvent:Connect(function(player, target)
local weapon = Weapons.Equipped(player) -- the server knows what's in their hand
local char = player.Character
if not weapon or not char then return end
if typeof(target) ~= "Instance" or not target:IsA("Model") or target == char then return end
local now = os.clock()
if now - (lastSwing[player] or 0) < weapon.Cooldown then return end
local from, to = char:GetPivot().Position, target:GetPivot().Position
if (to - from).Magnitude > weapon.Range + REACH_SLACK then return end
if not Combat.LineOfSight(from, to, { char, target }) then return end
local humanoid = target:FindFirstChildOfClass("Humanoid")
if not humanoid or humanoid.Health <= 0 then return end
lastSwing[player] = now
humanoid:TakeDamage(weapon.Damage) -- the server's number, never the client's
end)
Retest: hits from out of range, through walls, faster than the weapon's cooldown or with a damage number attached are all ignored. Normal combat is unchanged.
The daily reward can be claimed again on every server
What's wrong
Who has claimed today is kept in a table on the server, not in the player's save. A new server has an empty table, so joining any other server pays the reward again.
Impact
A player who hops servers collects the daily reward as often as they like. It's limited to one reward's worth per join, which keeps it at Medium.
Steps to reproduce
- Start a Play test and claim the daily reward.
- Stop, start a new Play test (a fresh server) and claim again.
- The reward is paid a second time. On live servers, joining any other server does the same.
Fix
local claimed = {} -- for this server only
Remotes.ClaimDaily.OnServerEvent:Connect(function(player)
if claimed[player.UserId] then return end
claimed[player.UserId] = true
Profiles[player].Coins += 500
end)
local DAY = 86400
Remotes.ClaimDaily.OnServerEvent:Connect(function(player)
local data = Profiles[player] -- session-locked: only this server can write it
if not data then return end
local today = os.time() // DAY -- the UTC day number, the same on every server
if data.LastDaily == today then return end
data.LastDaily = today
data.Coins += 500
end)
The claim now lives in the player's save as a UTC day number. Saves are session-locked and written with UpdateAsync, so only the one server that holds a player's profile can change it.
Retest: a second claim on the same UTC day is refused on a fresh server; a claim the next day is paid normally.
No remote has a rate limit, so one client can lag the server
What's wrong
Every request is handled however often it arrives. Each PlayEmote call loads and plays an animation that's sent to every player, so a flood of them is expensive for the whole server.
Impact
2,000 calls a second from one client dropped the server from 60 to 9 frames a second. Everyone on that server lags and rubber-bands until the player leaves.
Steps to reproduce
- Start a local server with two players and switch the view to Player1's client.
- Run
while true do for _ = 1, 40 do game.ReplicatedStorage.Remotes.PlayEmote:FireServer("Wave") end task.wait() end. - Watch the server's frame rate in the Developer Console fall while Player2 rubber-bands.
Fix
local RateLimit = {}
local buckets = {} -- [player][remote] = { tokens, last }
-- allow `rate` calls a second, with short bursts of up to `burst`
function RateLimit.Allow(player, remote, rate, burst)
local mine = buckets[player]
if not mine then mine = {}; buckets[player] = mine end
local now = os.clock()
local b = mine[remote]
if not b then b = { tokens = burst, last = now }; mine[remote] = b end
b.tokens = math.min(burst, b.tokens + (now - b.last) * rate)
b.last = now
if b.tokens < 1 then return false end
b.tokens -= 1
return true
end
Players.PlayerRemoving:Connect(function(player) buckets[player] = nil end)
-- in EmoteServer:
-- if not RateLimit.Allow(player, "PlayEmote", 2, 4) then return end
Retest: the same flood gets 2 emotes a second through, and the server stays at 60 frames a second.
The admin panel is only hidden on the client
What's wrong
Every player receives the admin panel; a client script just leaves it switched off for non-admins. The server-side checks on the admin commands are correct, so nobody can use them, but anyone can read the panel's command list and the remotes it calls.
Impact
No direct harm. It hands an attacker a map of the internal tools and what each one expects, which makes probing for other holes easier.
Steps to reproduce
- Join a Play test as a non-admin and switch the view to the client.
- In the Explorer, open
Players › Player1 › PlayerGui › AdminGuiand setEnabledto true. - The full panel appears. Its buttons do nothing, but every command and remote name is visible.
Fix
if table.find(ADMINS, player.UserId) then
AdminGui.Enabled = true
end
-- AdminGui moved to ServerStorage: only admins are ever sent a copy
local AdminGui = ServerStorage.Admin.AdminGui
Players.PlayerAdded:Connect(function(player)
if Admins.IsAdmin(player.UserId) then -- the same list the commands check
AdminGui:Clone().Parent = player:WaitForChild("PlayerGui")
end
end)
Retest: non-admins no longer receive the panel, and the command remotes still refuse them.
Remote arguments aren't type-checked, so odd values throw errors
What's wrong
Handlers do maths on whatever arrives. A string throws an error, and NaN slips straight through math.clamp, because NaN fails every comparison.
Impact
Nothing exploitable was found: the errors fill the server log and a player can break their own settings. But it's the same gap that lets NaN get into saves and prices in other games, so it's worth closing everywhere.
Steps to reproduce
- From the client, run
game.ReplicatedStorage.Remotes.SetVolume:FireServer(0/0). - The player's saved volume is now NaN; sending
"loud"instead throws an error in the server output.
Fix
Remotes.SetVolume.OnServerEvent:Connect(function(player, volume)
Settings[player].Volume = math.clamp(volume, 0, 1)
end)
local Check = {}
-- a real number in range: NaN fails every comparison, infinity fails the range
function Check.Number(v, min, max)
return type(v) == "number" and v >= min and v <= max
end
function Check.String(v, maxLength)
return type(v) == "string" and #v <= maxLength
end
-- in SettingsServer:
Remotes.SetVolume.OnServerEvent:Connect(function(player, volume)
if not Check.Number(volume, 0, 1) then return end
Settings[player].Volume = volume
end)
Retest: strings, NaN, infinity and tables are ignored on all 9 remotes, with no errors in the output.
5 Retest
The studio applied the fixes in build 0.9.5, and each finding was tested again the same way it was found.
| ID | Finding | Severity | Status |
|---|---|---|---|
| LT-01 | The shop trusts the client's price | Critical | Fixed, verified |
| LT-02 | Double accept duplicates trade items | High | Fixed, verified |
| LT-03 | Hit remote trusts target and damage | High | Fixed, verified |
| LT-04 | Daily reward claimable on every server | Medium | Fixed, verified |
| LT-05 | No rate limits on remotes | Medium | Fixed, verified |
| LT-06 | Admin panel hidden only on the client | Low | Fixed, verified |
| LT-07 | Remote arguments not type-checked | Info | Fixed, verified |
Forged-request sweep after the fixes: 96 requests across all 14 remotes, made of wrong types, NaN, infinity, negative and huge numbers, 4,000-character strings and repeated or simultaneous calls. 0 accepted, 0 server errors.
6 What you get with an audit
- A report like this one, as a document: every finding with its severity, steps to reproduce and a fix.
- Fixes as code, ready to paste in, or applied for you in Team Create with the “I fix what I find” extra.
- A retest after your fixes, with the “Re-test after your fixes” extra, so you know each hole is really closed.
- A walkthrough call if you'd like to go through the report together.