Skip to content

Fix NoScript enforcement for sub commands in Lua scripts#1887

Merged
kevin-montrose merged 6 commits into
mainfrom
users/kmontrose/luaNoScriptFixes
Jun 18, 2026
Merged

Fix NoScript enforcement for sub commands in Lua scripts#1887
kevin-montrose merged 6 commits into
mainfrom
users/kmontrose/luaNoScriptFixes

Conversation

@kevin-montrose

Copy link
Copy Markdown
Contributor

There's a bug right now where sub commands are not included in the LuaRunner.NoScriptDetails bitmap.

Fixes that, adds a test.

This also adds a test to double check that ACLs are enforced, as there was no explicit test for that.

Copilot AI review requested due to automatic review settings June 18, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Lua scripting NoScript enforcement by including sub-commands in LuaRunner.NoScriptDetails, and extends the scripting test suite to validate both NoScript blocking and ACL enforcement when commands are invoked from Lua scripts.

Changes:

  • Extend LuaRunner.InitializeNoScriptDetails() to include NoScript sub-commands in the bitmap used by script permission checks.
  • Expand NoScriptCommandsForbidden to test NoScript restrictions for both top-level commands and sub-commands invoked via redis.call.
  • Add a scripting test to verify ACL permission failures are enforced during redis.call execution.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/standalone/Garnet.test.scripting/LuaScriptTests.cs Adds/extends tests for NoScript enforcement (including sub-commands) and ACL enforcement from Lua scripts.
libs/server/Lua/LuaRunner.cs Updates NoScriptDetails bitmap initialization to include NoScript-flagged sub-commands.

Comment thread test/standalone/Garnet.test.scripting/LuaScriptTests.cs
Comment thread test/standalone/Garnet.test.scripting/LuaScriptTests.cs
@kevin-montrose kevin-montrose merged commit 237c328 into main Jun 18, 2026
299 of 301 checks passed
@kevin-montrose kevin-montrose deleted the users/kmontrose/luaNoScriptFixes branch June 18, 2026 18:54
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.

3 participants