Skip to content

Guard recursive Lua table bitstream reads#4798

Merged
qaisjp merged 2 commits intomultitheftauto:masterfrom
Zephkek:fix/lua-table-read-depth-limit
Apr 12, 2026
Merged

Guard recursive Lua table bitstream reads#4798
qaisjp merged 2 commits intomultitheftauto:masterfrom
Zephkek:fix/lua-table-read-depth-limit

Conversation

@Zephkek
Copy link
Copy Markdown
Contributor

@Zephkek Zephkek commented Apr 12, 2026

Summary

  • add a 64-level recursion limit when reading nested Lua tables from bitstreams
  • apply the guard on both client and server deserialization paths
  • preserve existing call sites by threading depth through defaulted parameters

Why

The public source currently allows unbounded recursive LUA_TTABLE reads from the bitstream serializer. A crafted packet can drive recursive descent until deserialization fails from stack exhaustion or excessive recursion.

Current shipped binaries already enforce a 64-level limit in this path. This change brings the public source in line with that behavior so downstream forks and public builds do not keep the unbounded recursion path.

Testing

  • validated the touched files with editor diagnostics
  • manually reviewed the nested-table bitstream read path to confirm inputs deeper than 64 levels now fail deserialization
  • reviewed the patch scope to confirm it only changes the bitstream table read path

@Zephkek Zephkek requested a review from a team as a code owner April 12, 2026 15:51
qaisjp
qaisjp previously approved these changes Apr 12, 2026
Copy link
Copy Markdown
Member

@qaisjp qaisjp left a comment

Choose a reason for hiding this comment

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

Nice find, thanks!

@qaisjp qaisjp enabled auto-merge (squash) April 12, 2026 16:03
@qaisjp qaisjp disabled auto-merge April 12, 2026 16:27
@qaisjp qaisjp merged commit 50ef80c into multitheftauto:master Apr 12, 2026
10 checks passed
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.

2 participants