Add Lua level: Metatable Hooks (revives #128 by @TheDarkThief) - #214
Closed
ZayanKhan-12 wants to merge 1 commit into
Closed
Add Lua level: Metatable Hooks (revives #128 by @TheDarkThief)#214ZayanKhan-12 wants to merge 1 commit into
ZayanKhan-12 wants to merge 1 commit into
Conversation
Re-homes the Lua metatable __index hook RCE challenge from PR skills#128 into a standalone Bonus-Levels/ folder. The original PR targeted Season-4/Level-1, which now collides with the ProdBot Season 4; placing it under Bonus-Levels/ avoids the collision while preserving the level and its maintainer review. Level authored by @TheDarkThief. Path references updated for the new location; devcontainer installs lua5.4 + luarocks + busted and adds the sumneko.lua extension (upstream ProdBot setup untouched). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2 tasks
Author
|
Closing in favor of the original PR #128 by @TheDarkThief — I've offered the re-homed, conflict-free version there for them to fold into their own PR so credit stays with the original author. No need for a competing PR. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This revives the Lua metatable
__indexhook level from #128 by @TheDarkThief, which@jkcsoreviewed and wanted to accept but which has since gone stale and now conflicts with the current Season 4.All credit for the level goes to @TheDarkThief — the commit is authored under their name and the content is unchanged apart from the re-homing described below.
What changed vs #128
Bonus-Levels/Lua-Metatable-Hooks/instead ofSeason-4/Level-1/. When Adding New Level: Lua Metatable hooks #128 was opened, Season 4 did not exist;mainnow has the full ProdBot Season 4, so the original path collides (add/add onSeason-4/README.md,.devcontainer/devcontainer.json). A standalone folder keeps the ProdBot narrative intact and resolves all conflicts..devcontainer/codeql-analysis.ymledits, which had become stale rollbacks (they removed the current ProdBot setup and downgradedactions/checkout@v7→v4,codeql-action@v4.37.3→v3). Instead this only appendslua5.4+luarocks+bustedand thesumneko.luaextension to the existing devcontainer.README.md.The level
A Lua metatable
__indexhook that exfiltrates a local (secret_key) viadebug.getlocalwhen the vulnerable code indexes a table withnilgaps. The fix sanitizes untrusted tables with apcall(setmetatable, t, {})guard (a set__metatablethrows, revealing the hook).Tests (busted)
tests.lua→ 2/2 passsolution/solution_test.lua→ 3/3 passhack.luafails against the vulnerablecode.luaby design (that failing exploit test is the challenge)On process & placement
I know
CONTRIBUTING.mdasks for a Discussions proposal first — I opened this as a PR because the level was already maintainer-reviewed in #128. Happy to move it to a New Level Proposal discussion, and happy to relocate it (e.g. a numbered Season slot) if you prefer a different home. Also glad to close this in favour of @TheDarkThief updating #128 directly if that is the maintainers' preference.