[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CSKT7NW91T7RHEKSHYJ89C":3,"skill-same:01M7CSKT7NW91T7RHEKSHYJ89C":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7CSKT7NW91T7RHEKSHYJ89C","game-security-pitfalls",null,"Use when reviewing game code in C#, GDScript or C++ (Unity, Godot, Unreal, custom engines) - client vs server authority, RPC and packet validation, in-app purchases and economy, save and replay files, mod and script loading, secrets in client builds","makifbaysal\u002Ftasktrooper","makifbaysal","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F25031940?v=4","01M7CRG3ZCSYZSSEVDMW3DEYC8","Mehmet Akif Baysal","01M7CRG401FJ8YAXH5ER730XYV",122,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fsecurity-agent\u002Fskills\u002Fgame-security-pitfalls\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: game-security-pitfalls\ncategory: security\ndescription: Use when reviewing game code in C#, GDScript or C++ (Unity, Godot, Unreal, custom engines) - client vs server authority, RPC and packet validation, in-app purchases and economy, save and replay files, mod and script loading, secrets in client builds\ntech_stack: Game code\nsource: original; informed by trailofbits\u002Fskills (CC BY-SA 4.0, ideas only, own wording) and Glenn Fiedler's networking articles (gafferongames.com, cited); Unity, Godot and Unreal networking and serialization documentation cited, not reproduced\n---\n# Game Security Pitfalls\n\n## Overview\n\nEverything in the client — memory, files, packets — belongs to the player. That makes most single-player cheating a non-finding (attacker and victim are the same person) and makes everything that affects **other players or real money** a real one: multiplayer outcomes, leaderboards, trading, purchases, shared content.\n\n**Core principle:** clients send intent (\"move north\", \"fire toward x\"), the server decides outcomes (\"hit for 37\"). Any message that carries an outcome is a finding when other players depend on it.\n\n## 1. Server Authority (CWE-602)\n\n```csharp\n\u002F\u002F ❌ Unity Netcode for GameObjects: any client can call it, and it reports the result\n[ServerRpc(RequireOwnership = false)]\nvoid ApplyDamageServerRpc(ulong targetId, int damage) { players[targetId].Health -= damage; }\n\n\u002F\u002F ✅ the client sends intent; the server checks the sender and computes the outcome\n[Rpc(SendTo.Server)]\nvoid FireRpc(Vector3 direction, RpcParams rpcParams = default) {\n    var shooter = PlayerFor(rpcParams.Receive.SenderClientId);\n    if (!shooter.CanFire()) return;\n    weapons.ResolveShot(shooter, direction.normalized);\n}\n```\n\n```gdscript\n# ❌ Godot: any peer may call it and claim any score\n@rpc(\"any_peer\")\nfunc submit_score(player_id: int, score: int) -> void:\n    scores[player_id] = score\n\n# ✅ identity from the transport, outcome from server state\n@rpc(\"any_peer\", \"reliable\")\nfunc request_finish_level() -> void:\n    var id := multiplayer.get_remote_sender_id()\n    scores[id] = compute_score(id)\n```\n\n```cpp\n\u002F\u002F ❌ Unreal: the validation function accepts everything\nbool AMyCharacter::ServerSetHealth_Validate(float NewHealth) { return true; }\n\u002F\u002F ✅ no client-settable health; server RPCs carry inputs and validate ranges\nbool AMyCharacter::ServerUseItem_Validate(int32 Slot) { return Slot >= 0 && Slot \u003C Inventory.Num(); }\n```\n\nAlso: Mirror `[Command(requiresAuthority = false)]` acting on objects the caller does not own; a client-authoritative transform with no server-side speed or teleport check in a competitive mode.\n\n## 2. Network Message Validation\n\nEvery field in a packet is attacker-chosen.\n\n- **Sizes and indices:** a length or count read from the packet used to allocate, copy or index. In C\u002FC++ this is memory corruption (CWE-120, CWE-787) — in scope, since these are not memory-safe languages (native-memory-safety-and-ffi for bounds, integer overflow and lifetimes).\n- **Ranges:** item slots, entity ids, enum values, positions; `NaN` and `Infinity` floats passing `\u003C`\u002F`>` checks.\n- **Ownership:** the entity id in the message belongs to the sender.\n- **Versioning:** an unknown message type or version is rejected, not interpreted with the newest layout.\n\n```cpp\n\u002F\u002F ❌ count comes from the wire\nuint16_t count = reader.ReadU16();\nfor (int i = 0; i \u003C count; ++i) items[i] = reader.ReadU32();   \u002F\u002F items holds 32\n\u002F\u002F ✅\nuint16_t count = reader.ReadU16();\nif (count > std::size(items) || reader.Remaining() \u003C count * 4) return Disconnect(peer);\n```\n\n## 3. Economy and Purchases\n\n- Currency, items or entitlements granted from a client message, or from an in-app purchase receipt validated only on the device → free items for everyone with a proxy. Receipts are verified server-side with the store, once, and recorded to stop replay.\n- Trades and crafting resolved client-side; duplicate-item races on the server where the same item can be spent twice (this is integrity, not a theoretical race — report it when two requests can both pass the check).\n\n## 4. Hidden Information\n\nSending state the player should not see — other players' hands, fog-of-war positions, upcoming loot — to every client lets any modified client reveal it. In competitive modes it is a finding (MEDIUM to HIGH); filter what the server replicates per player.\n\n## 5. Save Files, Replays and Shared Content (CWE-502)\n\nTampering with a local single-player save is not a finding. Deserializing a file that **someone else** can supply is:\n\n- C# `BinaryFormatter` (also `NetDataContractSerializer`, `LosFormatter`) on save files, replays or downloaded content → code execution; use `System.Text.Json`, MessagePack with known types, or a custom schema.\n- Godot: `FileAccess.get_var(true)`, `bytes_to_var_with_objects`, and loading `.tres`\u002F`.res`\u002F`.tscn` from untrusted sources can instantiate objects with embedded scripts; use `get_var()` with objects disallowed, or JSON.\n- Saves uploaded to cloud slots, leaderboards or PvP snapshots are server input — validate them like any request.\n\n## 6. Mods, Scripts and User-Generated Content\n\n- Loading assemblies or native libraries from a mods directory (`Assembly.LoadFrom`, `dlopen`), Lua with `os`\u002F`io`\u002F`load` available, GDScript or other engine scripts from downloaded content: full code execution on the player's machine. A finding when the game fetches or auto-installs that content from untrusted sources, or advertises it as sandboxed when it is not.\n- A **server** that loads player-uploaded scripts, maps or replays without sandboxing → CRITICAL.\n- Downloaded content paths (zip-slip in mod archives — path-traversal-and-file-handling).\n\n## 7. Secrets in Client Builds\n\nBack-end admin or title secret keys (live-ops platforms, publisher web API keys, analytics write secrets with admin scope, dedicated-server credentials) compiled into the client are leaked to every player. Public client ids are fine.\n\n## Not Findings\n\nSingle-player cheats, memory editing of the player's own game, speed-ups in offline modes, missing anti-cheat or obfuscation, a client that can see data it legitimately needs to render.\n\n## Common Mistakes\n\n- Reporting a single-player save edit as a vulnerability.\n- Reporting C# or GDScript memory safety — memory-safe; C++ packet parsing is the exception.\n- Accepting a `_Validate` function or a `RequireOwnership` flag as proof the server checks the outcome.\n\n## Red Flags\n\n- RPCs or messages named `Set…`, `Add…`, `Grant…`, `SubmitScore…` callable by clients.\n- `RequireOwnership = false`, `requiresAuthority = false`, `@rpc(\"any_peer\")` without a sender check.\n- `_Validate` returning `true` unconditionally.\n- `BinaryFormatter`, `get_var(true)`, `Assembly.LoadFrom` on files other people supply.\n- Purchase grants with no server-side receipt verification.\n\n## References (names and links only)\n\n[Unity Netcode for GameObjects](https:\u002F\u002Fdocs-multiplayer.unity3d.com\u002F) · [Godot high-level multiplayer](https:\u002F\u002Fdocs.godotengine.org\u002Fen\u002Fstable\u002Ftutorials\u002Fnetworking\u002Fhigh_level_multiplayer.html) · [Unreal RPCs](https:\u002F\u002Fdev.epicgames.com\u002Fdocumentation\u002Fen-us\u002Funreal-engine\u002Fremote-procedure-calls-in-unreal-engine) · [gafferongames networking](https:\u002F\u002Fgafferongames.com\u002F) · [BinaryFormatter security guide](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fstandard\u002Fserialization\u002Fbinaryformatter-security-guide) · CWE-120, 502, 602, 787\n","# Game Security Pitfalls\n\n## Overview\n\nEverything in the client — memory, files, packets — belongs to the player. That makes most single-player cheating a non-finding (attacker and victim are the same person) and makes everything that affects **other players or real money** a real one: multiplayer outcomes, leaderboards, trading, purchases, shared content.\n\n**Core principle:** clients send intent (\"move north\", \"fire toward x\"), the server decides outcomes (\"hit for 37\"). Any message that carries an outcome is a finding when other players depend on it.\n\n## 1. Server Authority (CWE-602)\n\n```csharp\n\u002F\u002F ❌ Unity Netcode for GameObjects: any client can call it, and it reports the result\n[ServerRpc(RequireOwnership = false)]\nvoid ApplyDamageServerRpc(ulong targetId, int damage) { players[targetId].Health -= damage; }\n\n\u002F\u002F ✅ the client sends intent; the server checks the sender and computes the outcome\n[Rpc(SendTo.Server)]\nvoid FireRpc(Vector3 direction, RpcParams rpcParams = default) {\n    var shooter = PlayerFor(rpcParams.Receive.SenderClientId);\n    if (!shooter.CanFire()) return;\n    weapons.ResolveShot(shooter, direction.normalized);\n}\n```\n\n```gdscript\n# ❌ Godot: any peer may call it and claim any score\n@rpc(\"any_peer\")\nfunc submit_score(player_id: int, score: int) -> void:\n    scores[player_id] = score\n\n# ✅ identity from the transport, outcome from server state\n@rpc(\"any_peer\", \"reliable\")\nfunc request_finish_level() -> void:\n    var id := multiplayer.get_remote_sender_id()\n    scores[id] = compute_score(id)\n```\n\n```cpp\n\u002F\u002F ❌ Unreal: the validation function accepts everything\nbool AMyCharacter::ServerSetHealth_Validate(float NewHealth) { return true; }\n\u002F\u002F ✅ no client-settable health; server RPCs carry inputs and validate ranges\nbool AMyCharacter::ServerUseItem_Validate(int32 Slot) { return Slot >= 0 && Slot \u003C Inventory.Num(); }\n```\n\nAlso: Mirror `[Command(requiresAuthority = false)]` acting on objects the caller does not own; a client-authoritative transform with no server-side speed or teleport check in a competitive mode.\n\n## 2. Network Message Validation\n\nEvery field in a packet is attacker-chosen.\n\n- **Sizes and indices:** a length or count read from the packet used to allocate, copy or index. In C\u002FC++ this is memory corruption (CWE-120, CWE-787) — in scope, since these are not memory-safe languages (native-memory-safety-and-ffi for bounds, integer overflow and lifetimes).\n- **Ranges:** item slots, entity ids, enum values, positions; `NaN` and `Infinity` floats passing `\u003C`\u002F`>` checks.\n- **Ownership:** the entity id in the message belongs to the sender.\n- **Versioning:** an unknown message type or version is rejected, not interpreted with the newest layout.\n\n```cpp\n\u002F\u002F ❌ count comes from the wire\nuint16_t count = reader.ReadU16();\nfor (int i = 0; i \u003C count; ++i) items[i] = reader.ReadU32();   \u002F\u002F items holds 32\n\u002F\u002F ✅\nuint16_t count = reader.ReadU16();\nif (count > std::size(items) || reader.Remaining() \u003C count * 4) return Disconnect(peer);\n```\n\n## 3. Economy and Purchases\n\n- Currency, items or entitlements granted from a client message, or from an in-app purchase receipt validated only on the device → free items for everyone with a proxy. Receipts are verified server-side with the store, once, and recorded to stop replay.\n- Trades and crafting resolved client-side; duplicate-item races on the server where the same item can be spent twice (this is integrity, not a theoretical race — report it when two requests can both pass the check).\n\n## 4. Hidden Information\n\nSending state the player should not see — other players' hands, fog-of-war positions, upcoming loot — to every client lets any modified client reveal it. In competitive modes it is a finding (MEDIUM to HIGH); filter what the server replicates per player.\n\n## 5. Save Files, Replays and Shared Content (CWE-502)\n\nTampering with a local single-player save is not a finding. Deserializing a file that **someone else** can supply is:\n\n- C# `BinaryFormatter` (also `NetDataContractSerializer`, `LosFormatter`) on save files, replays or downloaded content → code execution; use `System.Text.Json`, MessagePack with known types, or a custom schema.\n- Godot: `FileAccess.get_var(true)`, `bytes_to_var_with_objects`, and loading `.tres`\u002F`.res`\u002F`.tscn` from untrusted sources can instantiate objects with embedded scripts; use `get_var()` with objects disallowed, or JSON.\n- Saves uploaded to cloud slots, leaderboards or PvP snapshots are server input — validate them like any request.\n\n## 6. Mods, Scripts and User-Generated Content\n\n- Loading assemblies or native libraries from a mods directory (`Assembly.LoadFrom`, `dlopen`), Lua with `os`\u002F`io`\u002F`load` available, GDScript or other engine scripts from downloaded content: full code execution on the player's machine. A finding when the game fetches or auto-installs that content from untrusted sources, or advertises it as sandboxed when it is not.\n- A **server** that loads player-uploaded scripts, maps or replays without sandboxing → CRITICAL.\n- Downloaded content paths (zip-slip in mod archives — path-traversal-and-file-handling).\n\n## 7. Secrets in Client Builds\n\nBack-end admin or title secret keys (live-ops platforms, publisher web API keys, analytics write secrets with admin scope, dedicated-server credentials) compiled into the client are leaked to every player. Public client ids are fine.\n\n## Not Findings\n\nSingle-player cheats, memory editing of the player's own game, speed-ups in offline modes, missing anti-cheat or obfuscation, a client that can see data it legitimately needs to render.\n\n## Common Mistakes\n\n- Reporting a single-player save edit as a vulnerability.\n- Reporting C# or GDScript memory safety — memory-safe; C++ packet parsing is the exception.\n- Accepting a `_Validate` function or a `RequireOwnership` flag as proof the server checks the outcome.\n\n## Red Flags\n\n- RPCs or messages named `Set…`, `Add…`, `Grant…`, `SubmitScore…` callable by clients.\n- `RequireOwnership = false`, `requiresAuthority = false`, `@rpc(\"any_peer\")` without a sender check.\n- `_Validate` returning `true` unconditionally.\n- `BinaryFormatter`, `get_var(true)`, `Assembly.LoadFrom` on files other people supply.\n- Purchase grants with no server-side receipt verification.\n\n## References (names and links only)\n\n[Unity Netcode for GameObjects](https:\u002F\u002Fdocs-multiplayer.unity3d.com\u002F) · [Godot high-level multiplayer](https:\u002F\u002Fdocs.godotengine.org\u002Fen\u002Fstable\u002Ftutorials\u002Fnetworking\u002Fhigh_level_multiplayer.html) · [Unreal RPCs](https:\u002F\u002Fdev.epicgames.com\u002Fdocumentation\u002Fen-us\u002Funreal-engine\u002Fremote-procedure-calls-in-unreal-engine) · [gafferongames networking](https:\u002F\u002Fgafferongames.com\u002F) · [BinaryFormatter security guide](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fstandard\u002Fserialization\u002Fbinaryformatter-security-guide) · CWE-120, 502, 602, 787\n",{"name":5,"source":24,"category":25,"tech_stack":26,"description":7},"original; informed by trailofbits\u002Fskills (CC BY-SA 4.0, ideas only, own wording) and Glenn Fiedler's networking articles (gafferongames.com, cited); Unity, Godot and Unreal networking and serialization documentation cited, not reproduced","security","Game code","main","910394a0b6db9fc8c9a8f36328ec421d3ebd8b38","catalog\u002Fagents\u002Fsecurity-agent\u002Fskills\u002Fgame-security-pitfalls",18,"https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper","https:\u002F\u002Ftasktrooper.ai","https:\u002F\u002Fgithub.com\u002Fmakifbaysal","Senior Software Developer","2026-11-15 04:50:29",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add makifbaysal\u002Ftasktrooper --skill game-security-pitfalls",{"tool":42,"command":43},"bunx","bunx skills add makifbaysal\u002Ftasktrooper --skill game-security-pitfalls",{"tool":45,"command":46},"pnpm","pnpm dlx skills add makifbaysal\u002Ftasktrooper --skill game-security-pitfalls","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fsecurity-agent\u002Fskills\u002Fgame-security-pitfalls\u002FSKILL.md",true,[],[51,57,64,71,78,85],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7CSVEPQW6J6TD6CS2T5FPNZ","visual-craft","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fvisual-craft\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7CSVAQG91ETHQ0HBNZDG5FR","ux-copy","Use when you write any words a user reads in a mockup or a hand-off - content language and voice, buttons, labels, errors, empty states, confirmations, numbers and dates, and the longest-string check","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fux-copy\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7CSV6H0J38659NDXHJQ8396","screen-mockup-html","Use when you draw screens as the design task's HTML mockup - ONE canvas document holding every screen and every variant side by side, the sanitizer-safe recipe, phone and wide frames, the states grid, static control states, and the loopback self-check with screenshots at 375, 768 and 1440 attached to the task","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fscreen-mockup-html\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7CSV3JFRF3BM3XK52M7YEYR","performance-awareness","How the performance score moves for your role. Use when the score context shows a declining trend, or before handing off work you have not self-checked against every criterion.","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fperformance-awareness\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7CSTZDH00YRF5SCT7BRT9QD","design-variants","Use when a screen design needs variants - how many, variants as side-by-side rows on the one canvas, what makes two variants genuinely different, recommending one, how the human's choice is read, and narrowing to the chosen one in revision","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-variants\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7CSTV6P3SM3PAE28DB0RF77","design-system-authoring","Use when you derive, change or extend a design system - where tokens live per stack, the DTCG token tree, role-based names for both themes, base vs layer vs drift, the DESIGN.md section order, the inventory format, the contrast check and the lint every proposal returns","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-system-authoring\u002FSKILL.md",[],[]]