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
onclickhandlers - 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
onclickhandlers - 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.

