/

CVE-2026-61791

Severity:

HIGH RISK

(7.4)

Stored XSS (CWE-83) in OCO-Server Command Button UI

CVE-2026-61791

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-83

Impact:

Authenticated administrator session compromise and privileged action execution

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OCO-Server contains a stored cross-site scripting vulnerability in command buttons that embed a computer hostname into an inline JavaScript handler using HTML-only escaping. If an attacker can store a crafted hostname and an administrator activates an affected command button, script may execute in the administrator's authenticated browser session.

OCO-Server contains a stored cross-site scripting vulnerability in command buttons that embed a computer hostname into an inline JavaScript handler using HTML-only escaping. If an attacker can store a crafted hostname and an administrator activates an affected command button, script may execute in the administrator's authenticated browser session.

Affected context

The issue occurs in OCO-Server command-button rendering when a stored computer hostname is inserted into a JavaScript string within an inline onclick handler. The affected default VNC, RDP, SSH, and Ping commands use the vulnerable navigation branch. Exploitation generally depends on hostname data being accepted without suitable validation and later being rendered for an administrator.

The issue occurs in OCO-Server command-button rendering when a stored computer hostname is inserted into a JavaScript string within an inline onclick handler. The affected default VNC, RDP, SSH, and Ping commands use the vulnerable navigation branch. Exploitation generally depends on hostname data being accepted without suitable validation and later being rendered for an administrator.

Exploit preconditions

  • Attack surface: Administrator-facing computer details pages and default command buttons
  • Required access: Ability to store or influence a computer hostname; remote abuse may require the shared agent registration key and enabled agent self-registration
  • Trigger point: An administrator activates an affected command button
  • Why exploitation is possible: HTML entity encoding is applied to data that is subsequently interpreted as JavaScript, allowing the stored value to affect the inline handler's script context
  • Attack surface: Administrator-facing computer details pages and default command buttons
  • Required access: Ability to store or influence a computer hostname; remote abuse may require the shared agent registration key and enabled agent self-registration
  • Trigger point: An administrator activates an affected command button
  • Why exploitation is possible: HTML entity encoding is applied to data that is subsequently interpreted as JavaScript, allowing the stored value to affect the inline handler's script context

Why this happens

The underlying bug is a context mismatch in output encoding. htmlspecialchars(ENT_QUOTES) protects HTML text or attribute contexts but does not safely encode data embedded inside a JavaScript string. Because browsers decode HTML entities before interpreting the inline event handler, attacker-controlled hostname content can alter the intended script structure. This behavior maps to CWE-83: Improper Neutralization of Script-Related HTML Tags in a Web Page (XSS).

The underlying bug is a context mismatch in output encoding. htmlspecialchars(ENT_QUOTES) protects HTML text or attribute contexts but does not safely encode data embedded inside a JavaScript string. Because browsers decode HTML entities before interpreting the inline event handler, attacker-controlled hostname content can alter the intended script structure. This behavior maps to CWE-83: Improper Neutralization of Script-Related HTML Tags in a Web Page (XSS).

Potential impact

  • An attacker could execute script in an administrator's authenticated browser session
  • Session-related information or page data may be exposed
  • Administrative actions could be performed on the attacker's behalf
  • Software deployment jobs could be created or altered for managed computers
  • OCO-Server data or management workflows could be modified
  • An attacker could execute script in an administrator's authenticated browser session
  • Session-related information or page data may be exposed
  • Administrative actions could be performed on the attacker's behalf
  • Software deployment jobs could be created or altered for managed computers
  • OCO-Server data or management workflows could be modified

General mitigation guidance

Mitigation generally focuses on keeping untrusted data out of inline JavaScript contexts and reducing the trust placed in registration data.

Common defensive patterns include:

  • Prefer event listeners and structured DOM APIs over inline onclick handlers
  • Apply JavaScript-string or context-specific encoding when data must cross a scripting boundary
  • Validate and constrain hostnames according to an explicit hostname schema before storage
  • Treat agent-registration data as untrusted, even when registration uses a shared key
  • Keep agent self-registration disabled unless it is required and appropriately protected
  • Apply a restrictive Content Security Policy that limits inline script execution where feasible
  • Use least privilege for administrator roles and software-deployment capabilities
  • Add centralized output-encoding helpers that are specific to the target context

Mitigation generally focuses on keeping untrusted data out of inline JavaScript contexts and reducing the trust placed in registration data.

Common defensive patterns include:

  • Prefer event listeners and structured DOM APIs over inline onclick handlers
  • Apply JavaScript-string or context-specific encoding when data must cross a scripting boundary
  • Validate and constrain hostnames according to an explicit hostname schema before storage
  • Treat agent-registration data as untrusted, even when registration uses a shared key
  • Keep agent self-registration disabled unless it is required and appropriately protected
  • Apply a restrictive Content Security Policy that limits inline script execution where feasible
  • Use least privilege for administrator roles and software-deployment capabilities
  • Add centralized output-encoding helpers that are specific to the target context

How teams detect issues like this

High-level detection can include:

  • Static analysis rules for user-controlled values concatenated into inline event handlers or JavaScript strings
  • Code review checks for HTML escaping used in JavaScript, URL, CSS, or other non-HTML contexts
  • Searches for helper methods that construct script-bearing attributes from model or request data
  • Tests using benign delimiter and encoding variations to verify context-specific output handling
  • Policy enforcement that discourages inline script handlers and requires approved output-encoding utilities
  • Monitoring for unexpected agent registrations, hostname changes, and administrator-triggered deployment activity

Automated security review tools may help identify dangerous data-flow patterns, but findings should be validated against the actual browser parsing context.

High-level detection can include:

  • Static analysis rules for user-controlled values concatenated into inline event handlers or JavaScript strings
  • Code review checks for HTML escaping used in JavaScript, URL, CSS, or other non-HTML contexts
  • Searches for helper methods that construct script-bearing attributes from model or request data
  • Tests using benign delimiter and encoding variations to verify context-specific output handling
  • Policy enforcement that discourages inline script handlers and requires approved output-encoding utilities
  • Monitoring for unexpected agent registrations, hostname changes, and administrator-triggered deployment activity

Automated security review tools may help identify dangerous data-flow patterns, but findings should be validated against the actual browser parsing context.

Sources

SourceLink
github.comgithub.com/schorschii/OCO-Server/commit/ef02f9768e5e1792c3ee53c72e8d7e4ea58ddaa8
github.comgithub.com/schorschii/OCO-Server/releases/tag/v1.2.1
github.comgithub.com/schorschii/OCO-Server/security/advisories/GHSA-9c2r-9j95-22pr

Frequently asked

questions

It can be remotely exploitable when an attacker has a permitted path to store a hostname, such as agent self-registration with the required registration key and the relevant setting enabled. Other deployments may require an existing account or local access capable of changing computer inventory data.

Yes. The stored value must generally be rendered in the administrator-facing computer details view, and an administrator must activate an affected command button for the handler to run.

Avoid embedding untrusted values in inline JavaScript. Use event listeners or structured APIs, and apply encoding that matches the actual output context when a value must be transferred to client-side code.

Validate inventory fields at trust boundaries, treat registration data as untrusted, prohibit unsafe inline handlers through policy or browser controls, and review administrative workflows for stored input reaching script contexts.

It can be remotely exploitable when an attacker has a permitted path to store a hostname, such as agent self-registration with the required registration key and the relevant setting enabled. Other deployments may require an existing account or local access capable of changing computer inventory data.

Yes. The stored value must generally be rendered in the administrator-facing computer details view, and an administrator must activate an affected command button for the handler to run.

Avoid embedding untrusted values in inline JavaScript. Use event listeners or structured APIs, and apply encoding that matches the actual output context when a value must be transferred to client-side code.

Validate inventory fields at trust boundaries, treat registration data as untrusted, prohibit unsafe inline handlers through policy or browser controls, and review administrative workflows for stored input reaching script contexts.

Find out what's already
exploitable in your codebase.