---
id: "CVE-2026-61791"
kind: "vulnerability"
aliases: ["CVE-2026-61791"]
title: "OCO-Server: crafted hostname runs script in administrator sessions"
severity: "high"
cvss: 7.4
epss: 0.00287
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["endpoint-management", "oco-server", "package", "php", "self-hosted"]
not_affected_if: ["agent-self-registration-disabled", "version-1.2.1-or-later"]
published_at: "2026-10-22T15:17:05+00:00"
first_seen_at: "2026-10-23T21:57:31+00:00"
updated_at: "2026-10-25T03:25:37+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-61791", "first_seen_at": "2026-10-23T21:57:31+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-61791", "first_seen_at": "2026-10-24T07:15:51+00:00"}]
---

# OCO-Server: crafted hostname runs script in administrator sessions

OCO-Server, a self-hosted endpoint management app, puts a stored computer hostname unsafely into an inline onclick handler on its default command buttons. A crafted hostname can run script in an administrator's logged-in session when that button is clicked.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed OCO-Server version against `1.2.1`
- Check whether `agent-self-registration-enabled` is set to on in the server settings; unknown if the sources give the setting location
- Review stored computer hostnames for script-like characters such as quotes or angle brackets

## Fix

- Upgrade OCO-Server to `1.2.1` or later
- Keep `agent-self-registration-enabled` disabled, the default, until upgraded
- Rotate the `agent-registration-key` if it may have been shared beyond trusted agents

## Timeline

- 2026-10-23T21:57:31+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-61791
- 2026-10-24T07:15:51+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-61791

## From the sources

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(ENT_QUOTES)` 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::DEFAULT_COMPUTER_COMMANDS` in `lib/Models/Computer.class.php`, whose VNC, RDP, SSH, and Ping entries use `new_tab=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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
