Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-61791 Overview
CVE-2026-61791 is a stored Cross-Site Scripting (XSS) vulnerability in OCO-Server, a self-hosted endpoint management application for computer inventory, software deployment, and mobile device management. Versions prior to 1.2.1 render command buttons on the computer details page using Html::commandButton() in lib/Html.class.php. The helper embeds the action URL into a JavaScript string inside an inline onclick handler using only htmlspecialchars(ENT_QUOTES). Browsers decode HTML entities before interpreting the handler, which allows a crafted hostname to break out of the string. A remote attacker who possesses the shared agent-registration-key can store a malicious hostname when agent-self-registration-enabled is set, and the script runs in an administrator's session.
Critical Impact
Successful exploitation executes attacker-controlled JavaScript in an authenticated administrator session, allowing abuse of software deployment privileges across managed endpoints.
Affected Products
- OCO-Server versions prior to 1.2.1
- lib/Html.class.php — Html::commandButton() helper
- frontend/views/computer-details.php using Computer::DEFAULT_COMPUTER_COMMANDS (VNC, RDP, SSH, Ping entries)
Discovery Timeline
- 2026-10-22 - CVE-2026-61791 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-61791
Vulnerability Analysis
The flaw is a stored XSS classified under [CWE-83] (Improper Neutralization of Script in Attributes in a Web Page). Html::commandButton() constructs an inline onclick handler that concatenates the action URL into a JavaScript string literal. The URL is HTML-escaped with htmlspecialchars(ENT_QUOTES), but the browser decodes HTML entities before the handler is parsed as JavaScript. An attacker-controlled hostname containing encoded quote characters escapes the string context and runs arbitrary script.
The default command set in Computer::DEFAULT_COMPUTER_COMMANDS includes VNC, RDP, SSH, and Ping entries. These use new_tab=false and the vulnerable window.location branch, so no custom command configuration is required to trigger the issue. When an administrator activates one of these buttons on computer-details.php, the injected script executes with their session privileges, including the ability to push software deployment jobs to managed computers.
Root Cause
The root cause is reliance on HTML escaping to neutralize data placed inside a JavaScript string within an HTML attribute. HTML entity decoding occurs before JavaScript parsing, so escaped quotes revert to literal quotes and terminate the string. The hostname field, submitted by agents, is stored without validation and later concatenated into the handler.
Attack Vector
A remote attacker needs the shared agent-registration-key and a server with agent-self-registration-enabled turned on. Self-registration is disabled by default. The attacker calls the oco.agent.hello handler in frontend/api-agent.php to register an agent whose hostname contains a crafted XSS payload. The payload persists until an administrator views the computer details page and activates a default command button, at which point the script executes in the administrator's authenticated session.
// Patch in lib/Html.class.php — stored XSS fix for action URL in onclick handler
// Before: action URL concatenated into a JavaScript string literal via htmlspecialchars
// $onclick = "window.location=\"" . htmlspecialchars($actionUrl, ENT_QUOTES) . "\"";
// After: URL stored in an HTML attribute; handler reads it via getAttribute at runtime
if ($c['new_tab'])
$onclick = "window.open(this.getAttribute(\"actionurl\"))";
else
$onclick = "window.location=this.getAttribute(\"actionurl\")";
echo "<button title='" . htmlspecialchars($description, ENT_QUOTES) . "'"
. " actionurl='" . htmlspecialchars($actionUrl, ENT_QUOTES) . "'"
. " onclick='" . $onclick . "'>"
. (empty($c['icon']) ? "" : "<img src='" . $c['icon'] . "'> ")
. htmlspecialchars($c['name'])
. "</button>";
Source: GitHub Commit ef02f97
Detection Methods for CVE-2026-61791
Indicators of Compromise
- Computer records whose hostname field contains quote characters, angle brackets, HTML entities such as ", or JavaScript keywords like javascript:, onerror, or alert.
- Agent registrations arriving at frontend/api-agent.php via the oco.agent.hello handler from unexpected source addresses.
- Software deployment jobs created from an administrator session shortly after that administrator viewed a computer-details.php page.
Detection Strategies
- Query the OCO-Server database for hostnames that do not match a strict hostname pattern (RFC 1123 label rules).
- Review web server access logs for POST requests to frontend/api-agent.php with large or malformed JSON payloads.
- Correlate administrator UI activity with subsequent job creation events to flag anomalous automated deployments.
Monitoring Recommendations
- Enable verbose application logging for agent self-registration events and alert on new registrations.
- Monitor outbound requests from administrator browsers for connections to unknown domains after loading computer details pages.
- Track changes to the agent-registration-key and agent-self-registration-enabled configuration values.
How to Mitigate CVE-2026-61791
Immediate Actions Required
- Upgrade OCO-Server to version 1.2.1, which replaces the inline JavaScript concatenation with a getAttribute("actionurl") lookup.
- Disable agent-self-registration-enabled if it is not required for operations.
- Rotate the shared agent-registration-key and audit all existing computer records for suspicious hostnames.
- Review software deployment job history for jobs created without a legitimate change ticket.
Patch Information
The fix is included in OCO-Server v1.2.1 and documented in GHSA-9c2r-9j95-22pr. The patch in commit ef02f97 moves the action URL into a dedicated actionurl attribute and reads it from the DOM at click time, preventing the stored value from ever being parsed as JavaScript source.
Workarounds
- Set agent-self-registration-enabled to false and register agents manually through a trusted process.
- Restrict network access to frontend/api-agent.php using firewall rules or a reverse proxy so only known agent subnets can reach it.
- Validate hostnames server-side before storage, rejecting any value that contains characters outside the RFC 1123 label set.
# Example reverse proxy rule to restrict the agent API to a trusted subnet
# nginx snippet for frontend/api-agent.php
location = /frontend/api-agent.php {
allow 10.20.0.0/16; # trusted agent network
deny all;
include fastcgi_params;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

