Harden /ask helper, UDP replies and run_lua in multiplayer
- Pass the /ask question to claude on stdin so it can't be parsed as a CLI option. - Block run_lua in multiplayer unless an admin enables the new "Allow Lua queries in multiplayer" map setting. - Ignore UDP packets that don't come from the game's port, in both the MCP server and the ask helper. - Build the screenshot path from our own name instead of the game's reply, and restrict screenshot names in the mod. - Validate ask packets, cap question length and limit concurrent claude runs. - Replace hard-coded home paths in the README and systemd unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
8 files changed
+79
-28
No files matched your search
@@ -268,7 +268,9 @@ async def screenshot(
|
||||
meta = await game.request(
|
||||
"screenshot", x=x, y=y, width_tiles=width_tiles, alt_mode=alt_mode, daylight=daylight, surface=surface, name=name
|
||||
)
|
||||
path = SCRIPT_OUTPUT / meta.pop("path")
|
||||
# Built from our own name rather than the reply, so a reply can't point the unlink below elsewhere.
|
||||
meta.pop("path", None)
|
||||
path = SCRIPT_OUTPUT / "claude-co-engineer" / f"{name}.jpg"
|
||||
try:
|
||||
data = await _read_finished_jpeg(path)
|
||||
finally:
|
||||
|
||||
Reference in new issue
Block a user