T09 · Insecure Skill Coding Practices
- Location
scripts/remote_installer.py:82- Finding
RustDesk Credentials Are Exposed Through Logs and Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/remote_installer.py:82-84andscripts/remote_installer.py:732-735
Vulnerability Type: Plaintext credential exposure
Risk Level: HighVulnerable Code
python def connect(self, remote_id, password, timeout=60): """Connect to a remote computer.""" logging.info(f"Starting RustDesk connection: ID={remote_id}, password={password}")python parser.add_argument('--remote-id', help='RustDesk remote ID') parser.add_argument('--password', help='RustDesk verification password')The displayed English text is a direct translation of the original log and help strings; the executable behavior is unchanged.
Technical Analysis
The RustDesk password is interpolated directly into an
INFO-level log message. Logging is configured to write toscripts/installer.log, meaning the plaintext credential can remain on disk after the installation session ends.The password is also accepted as a command-line argument. On systems where process arguments are visible to other users or monitoring tools, the value may be exposed through process listings, diagnostic collectors, shell history, job definitions, or endpoint monitoring records.
RustDesk passwords are authentication credentials. They must be handled as secrets and must not be included in ordinary application logs or command-line arguments.
Attack Path
- An operator invokes the script with
--passwordand a RustDesk credential. - The credential becomes visible in the process command line.
- The
connectmethod writes the remote ID and plaintext password toscripts/installer.log. - A local user, log collector, support tool, or compromised process reads the log or captured process arguments.
- The attacker reuses the recovered credential to attempt access to the associated RustDesk endpoint.
Impact Assessment
Successful exploitation discloses remote-access credential ...[truncated 398 chars]
- An operator invokes the script with
- Remediation
View remediation
Remediation Suggestions
- Remove the password from all log messages. Log only a redacted remote ID where operationally necessary.
- Replace the
--passwordargument withgetpass.getpass(), protected standard input, or an operating-system secret provider. - Add a logging filter that redacts credentials, tokens, and other sensitive fields.
- Restrict access to
installer.logand define a short retention policy. - Rotate any RustDesk credentials that may already have been written to logs.
- Add automated tests that fail if sensitive parameter names or values appear in generated logs.
