Reject untrusted Lua bytecode while preserving script caching - #2138
Draft
Tiago Nápoli (tiagonapoli) wants to merge 9 commits into
Draft
Tiago Nápoli (tiagonapoli) wants to merge 9 commits into
Tiago Nápoli (tiagonapoli) wants to merge 9 commits into
Conversation
added 9 commits
September 15, 2026 14:34
Keep application bytecode caching while requiring customer input to compile in text-only mode and tagging internally generated chunks for binary-only loading. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ec2a6abf-4bb4-48e1-a752-32672cb07303
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ec2a6abf-4bb4-48e1-a752-32672cb07303
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ec2a6abf-4bb4-48e1-a752-32672cb07303
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ec2a6abf-4bb4-48e1-a752-32672cb07303
Generate the test bytecode directly through Garnet's internal compiler instead of round-tripping through a Lua script. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ec2a6abf-4bb4-48e1-a752-32672cb07303
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ec2a6abf-4bb4-48e1-a752-32672cb07303
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ec2a6abf-4bb4-48e1-a752-32672cb07303
Keep regression coverage focused on supported network-facing scripting workflows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ec2a6abf-4bb4-48e1-a752-32672cb07303
Remove the unrelated ScriptHashKey allocation refactor from the Lua bytecode fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ec2a6abf-4bb4-48e1-a752-32672cb07303
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.
Summary
EVALandSCRIPT LOADloadstringcompatibility handlingSecurity boundary
Customer input is always treated as source text and compiled with mode
t. Only successful internal compilation produces aGarnetGeneratedBinarychunk, which is cached and subsequently loaded with modeb. The publicLuaScriptHandleconstructor creates source-text handles, so arbitrary host-provided bytes cannot opt into binary loading.Testing
EVAL,SCRIPT LOAD, cache exclusion, blocked side effects, compilation failure output, embedded NUL input, host-inserted source, and cross-session cachingSupersedes #2111 while retaining bytecode caching.