Skip to content

fix bug - #3118

Open
Anarchid wants to merge 1 commit into
beyond-all-reason:masterfrom
Anarchid:fix-bug
Open

fix bug#3118
Anarchid wants to merge 1 commit into
beyond-all-reason:masterfrom
Anarchid:fix-bug

Conversation

@Anarchid

@Anarchid Anarchid commented Jul 18, 2026

Copy link
Copy Markdown

merge plz 🙏

🤖 Generated with Claude Code

Replace the weaker IsSafePath check with SafeWritePath for io.open,
os.remove/os.rename, and enable gating for VFS.Include/LoadFile/
CompressFolder and Spring.ExtractModArchiveFile. Fold the
springsettings.cfg/springrc blocking into SafeWritePath itself, since
the config file can redirect the write-dir and defeat all other checks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread rts/Lua/LuaVFS.cpp
Comment on lines +322 to +323
if (!LuaIO::SafeWritePath(fileName))
luaL_error(L, "[LuaVFS::%s] invalid access: %s", __func__, fileName.c_str());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why? this is a read path and not a write path

Comment thread rts/Lua/LuaVFS.cpp
// if (!LuaIO::IsSimplePath(filename)) return 0;
// keep searches within the data directories
if (!LuaIO::SafeWritePath(filename))
return 0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why does this one not do luaL_error like all the others? also this is a read path too

Comment thread rts/Lua/LuaIO.cpp
Comment on lines -103 to +87
if (!IsSafePath(path)) {
if (!SafeWritePath(path)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this should probably depend on mode str. if r then check safe read path, if wat check safe write path

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