"Program arguments [...] --password" in factorio-current.log should be redacted

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

martinvw
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Nov 01, 2023 4:01 pm
Contact:

"Program arguments [...] --password" in factorio-current.log should be redacted

Post by martinvw »

TL;DR
When connecting to a server with password, and then accepting the "sync mods" dialog (which triggers a restart), the server password is written to `factorio-current.log`:

Code: Select all

    0.051 Program arguments: "/home/martin/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio" "--mp-connect" "1.2.3.4:34197" "--password" "thisistheserverpassword" 
This makes it easy to accidentally expose the password when uploading the log file for crash reports.
What?
I experienced a crash due to a mod today. When I reported the issue on the mod's GitHub repository, I wanted to attach `factorio-current.log`; luckily I looked into it first, and noticed that the log file contained the server password. I assume this is due to the fact that I accepted a "sync mods" prompt when connecting, which caused Factorio to restart; after restarting, it won't prompt for the server password again, and apparently the password is passed as a command line argument between the instances.

I would suggest that Factorio should attempt to scrub the password from the command line before logging the command line to `factorio-current.log`. It seems pretty common to upload this log in bug reports (viewtopic.php?f=7&t=3638), so care should be taken to minimize the chance of accidental password exposure. (Sidenote: process arguments are world-readable at least on Linux (no idea how it works in Windows, but would imagine the same), so ideally secrets shouldn't be passed as parameters anyway. As the wide majority of Factorio players won't likely share their computer with other concurrent users they don't trust, this probably isn't of that much concern.)
Why?
To prevent password exposure when uploading crash logs.
Post Reply

Return to “Ideas and Suggestions”