mirror of
https://github.com/storytold/materialcraft.git
synced 2026-11-19 22:10:53 +01:00
The app wrote its control token to the temp folder with default permissions from a hash-based generator, compared it with ==, spawned unlimited threads and let an unauthenticated client hold a connection for 10 minutes. The shared token file was opened with create+truncate, which follows a planted symlink. - Token files are created new (remove, then O_EXCL) with mode 0600; clients only read a regular, owner-only, non-symlink file. - The app's control server uses the shared security module: OS-random token, constant-time compare, bounded lines, at most 16 connections, one auth attempt within 10 s, close on malformed JSON before auth. - serve --port and the app bind before writing the token file. Ported from TextureCraft 5a065c1 and 836e3f2.