
Public vulnerability report and proof-of-concept analysis of a cmd.exe /K argument injection (CWE-78) in the KytyPS5 launcher, covering root cause, verified RCE, and remediation.
/K argument injection in the KytyPS5 launcher (RCE)Status: confirmed end-to-end against the official release binary, not just the source tree.
Scope of this public report: CVE-1 only.
Target release: KytyPS5-2026-10-08-5a88080
(https://github.com/KytyPS5/KytyPS5/releases/tag/KytyPS5-2026-10-08-5a88080)
| property | value |
|---|---|
| release tag | KytyPS5-2026-10-08-5a88080 |
| git commit | 5a880808, reported version 0.3.0 (2026.10.08) |
| affected binary | launcher.exe (Windows x64, 4,175,360 bytes, SHA256 4796C3C445818B7957816DD28E1AD375C0E51757BD0DCD983EC3289AB6A9D515) |
| classification | CWE-78: OS Command Injection |
| sink | cmd.exe /K "<attacker controlled string>" |
| impact | arbitrary command execution as the logged-in user |
| preconditions | no game execution required; only a saved configuration value + double-click |
| platform | Windows only (see section 6) |
| CVSS 3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H = 7.8 (High) |
CVSS rationale: AV:L - the payload is a local config file the victim imports
(no network attack surface). PR:N - the attacker needs no privileges on the
victim machine. UI:R - the victim must import the configuration and launch
the game. S:U - the injected command runs as the same user as the launcher,
so no security authority boundary is crossed. C:H/I:H/A:H - the command can
read, modify, and destroy anything that user can access. A scope-changed reading
(S:C, not applicable here) would score 8.6.
The launcher does not start the emulator directly. On Windows it builds a
shell command string and hands it to cmd.exe with the /K switch:
cmd.exe /K ""C:\...\kyty_emulator.exe" "--opt" "value" ... "--game" "..."
The purpose of /K is to keep the console window open after the emulator
exits. The launcher quotes every token so that paths containing spaces
survive.
Several emulator options take free-form string values that come from the
user-editable configuration. Those strings are concatenated into the same
cmd.exe command line. If an attacker can place a double quote and an
ampersand into one of those values, cmd.exe's own parser is tricked into
ending the quoted region early, executing the injected command, and then
swallowing the remainder of the line with rem.
In the verified payload the injected command runs before
kyty_emulator.exe ever starts.
src/launcher/src/mainDialog.cpp:389-392
// Quote one token for cmd.exe so paths with spaces survive /K parsing.
static QString WinCmdQuote(QString value) {
value.replace(QLatin1Char('"'), QStringLiteral("\\\""));
return QLatin1Char('"') + value + QLatin1Char('"');
}
WinCmdQuote escapes a literal " as \". That is the C runtime
CommandLineToArgvW rule: backslash escapes the following quote when a
program parses its argv.
cmd.exe does not implement that rule. cmd.exe decides whether &, |,
<, > and ^ are metacharacters purely by tracking whether the current
character position is inside or outside a double-quoted region, and a "
simply toggles that state. A backslash in front of a " is, to cmd.exe, just
a backslash followed by a quote.
So for cmd.exe the sequence
"....\"&calc&rem \""
^ ^ ^
ON | +-- toggles OFF, so the following & is OUTSIDE quotes
+----- backslash is inert
The token still looks correctly quoted to any C program that later parses
argv (that is why the emulator receives the raw value), but cmd.exe has
already been tricked into running calc.
src/launcher/src/mainDialog.cpp:394-401
static QString BuildWinCmdKCommand(const QString& interpreter, const QStringList& args) {
QString command = WinCmdQuote(QDir::toNativeSeparators(interpreter));
for (const auto& arg: args) {
command += QLatin1Char(' ');
command += WinCmdQuote(arg);
}
return command;
}
src/launcher/src/mainDialog.cpp:438-445
#elif defined(_WIN32)
{
// Use nativeArguments so Qt does not re-quote the /K command string.
process->setProgram(CMD_EXE);
process->setArguments({});
process->setNativeArguments(QStringLiteral("/K \"") +
BuildWinCmdKCommand(interpreter, args) + QLatin1Char('"'));
}
nativeArguments is passed to CreateProcessW verbatim; Qt performs no
further escaping (that is the explicit intent of the comment). CMD_EXE is
cmd.exe (mainDialog.cpp:53).
CREATE_NEW_CONSOLE is set at mainDialog.cpp:453, so a visible console
window is created for the injected command as well.
The vulnerable /K quoting path was introduced by
PR #244 (fixing
issue #179, paths with
spaces) - a functional fix that was never reviewed as a security change.
src/launcher/src/mainDialog.cpp:217-295 (CreateEmulatorArgs) appends
configuration strings unconditionally. The following are unbounded, arbitrary
strings with no character allow-list:
| option | configuration field | line |
|---|---|---|
--shader-log-folder | shader_log_folder | mainDialog.cpp:260 |
--command-buffer-dump-folder | command_buffer_dump_folder | mainDialog.cpp:262 |
--printf-output-file | printf_output_file | mainDialog.cpp:264 |
--mic | audio_input_device | mainDialog.cpp:228 |
--controller-color | controller.color | mainDialog.cpp:231 |
Configuration::SetGameSettings (configuration.cpp:110-149) copies these
fields straight from the imported JSON with no sanitisation - compare
user_name, which is capped at MAX_USER_NAME_LENGTH (16 bytes,
common/emulatorConfig.h) but is not the only string that reaches the
command line.
--shader-log-folder is of particular interest because it is passed
unconditionally, even when shader_log_direction == Silent (the
default), so no UI interaction beyond clicking the game row is needed.
| # | scenario | required access |
|---|---|---|
| A | Shared configuration: the launcher's "Game Configs -> Import..." accepts a JSON file. A victim imports a "recommended settings" or "performance preset" from a forum, Discord, or cheat site, then double-clicks a game. | victim interaction (import + launch) |
| B | Writable Kyty.ini: on Windows the settings file is opened with QSettings::SystemScope (configurationListWidget.cpp:354-357), i.e. C:\ProgramData\Kyty\Kyty.ini. Any process or user that can write this file plants the payload; the next launch by any user of the machine executes it. | write access to a shared settings path |
| C | Already-present foothold: RMM tool, other low-privilege malware, or a malicious dropper rewrites the ini before the user launches the game - escalating to interactive user code execution. | existing foothold |
The vulnerability does not require a malicious game image, does not
require the emulator to run, and does not require any EXIT_IF-gated
code path.
shader_log_folder is persisted by Qt QSettings in INI format, where
backslash is the escape character. Measured behaviour (an internal probe
wrote four candidate values and reported what actually reaches cmd.exe):