Security: predictable /tmp/nc_exit_status in postdetails - symlink clobber and TOCTOU
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #5035 của @dgibbs64 — đã merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
Hướng nghiên cứu
Bắt đầu tại lgsm/modules/command_postdetails.sh, khoảng các dòng 63-65, và kiểm tra nhóm lệnh gọi termbin.com, ghi vào /tmp/nc_exit_status rồi đọc lại giá trị đó. Chạy ./gameserver pd và xác minh rằng việc xử lý trạng thái thoát không còn phụ thuộc vào một đường dẫn tạm thời dùng chung có thể dự đoán hoặc một race condition khi ghi/đọc.
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)
Predictable /tmp/nc_exit_status file in postdetails — symlink clobber + write/read race
Affected: lgsm/modules/command_postdetails.sh:63-65
nc -w 10 termbin.com 9999
echo $? > /tmp/nc_exit_status
} | tr -d '\n\0')
nc_exit_status=$(cat /tmp/nc_exit_status)
Two problems:
- Fixed world-writable path with no
mktemp/O_EXCL/noclobber: a local attacker pre-creates/tmp/nc_exit_statusas a symlink to a victim-owned file (e.g.~/.bashrc). Next time the victim runs./gameserver pd, the redirect truncates the target with0\n— arbitrary file clobber as the victim user (CWE-59/CWE-377). - TOCTOU between write and read: an attacker can swap the file contents between line 63 and line 65 to corrupt the status logic; the file is also shared across concurrent LGSM instances.
Suggested fix
Drop the temp file entirely:
nc -w 10 termbin.com 9999
nc_exit_status=$?
…inside the same command group, or use mktemp under ${tmpdir} if the split is required.
Fix
Implemented in PR #5035: https://github.com/GameServerManagers/LinuxGSM/pull/5035 (merged into develop for v26.4.0).
- 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: install command: start distro: Debian engine: source2 game: Counter-Strike 2 regression: yes reproducible: always severity: high type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
GameServerManagers/LinuxGSM#5106 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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
Tất cả issue của GameServerManagers/LinuxGSM
Issue tương tự
-
Update migenĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
YosysHQ/oss-cad-suite-build#220 ·
-
fm-spawn: isolation timeout hides the real treehouse get error and closes the pane that holds itĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
kunchenguid/firstmate#7848 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: partitioner only creates next month, so one failed run leaves a month with no partitionĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: state the LF Projects antitrust policy in the repositoryCó thể đã có người làm @vinoo999 đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
a2aproject/A2A#2394 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
`sudo visudo` opens an empty buffer named `--` instead of /etc/sudoers.tmp (regression from #11495)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
omacom/omarchy#16768 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày