CVE-2026-61791: OCO-Server: Stored XSS through agent hostnames in command buttons
OCO-Server is a self-hosted endpoint management application for computer inventory, software deployment, and mobile device management. Prior to 1.2.1, Html::commandButton() in lib/Html.class.php embeds an action URL containing a stored computer hostname into a JavaScript string in an inline onclick handler, using htmlspecialchars(ENTQUOTES) only for HTML escaping. Browsers decode the HTML entities before interpreting the handler as JavaScript, allowing a crafted hostname to escape the string and execute script in an administrator's authenticated session when an affected command button is activated. frontend/views/computer-details.php passes $computer->hostname to this helper using Computer::DEFAULTCOMPUTERCOMMANDS in lib/Models/Computer.class.php, whose VNC, RDP, SSH, and Ping entries use newtab=false and the vulnerable window.location branch. A remote attacker who possesses the shared agent-registration-key can use the oco.agent.hello handler in frontend/api-agent.php to store an unchecked hostname when agent-self-registration-enabled is enabled; self-registration is disabled by default. The vulnerable default command buttons require no custom command configuration. The injected script can abuse the administrator's privileges, including permission to deploy software jobs to managed computers. This issue is fixed in version 1.2.1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
OCO-Serverto a version that resolves this vulnerability.Fixed in 1.2.1
Event History
Frequently Asked Questions
Which deployments can be reached remotely through agent registration?
Remote hostname injection requires the shared agent-registration-key and enabled agent self-registration. Self-registration is disabled by default, so deployments that have not enabled it are not exposed through the described remote registration path.
Are custom command button settings required for exploitation?
No. The default VNC, RDP, SSH, and Ping computer commands use the vulnerable window.location path with new_tab=false, so no custom command configuration is required.
What administrator action triggers the stored payload?
An administrator must activate an affected command button for the computer with the crafted hostname. The script then executes in that administrator's authenticated browser session.
Which versions need remediation?
OCO-Server versions prior to 1.2.1 are affected. Version 1.2.1 is identified as the release containing the fix.