Summary
Nagios Core and Nagios XI contain a cross-site request forgery protection bypass caused by trusting attacker-supplied matching cookie and request parameter values. An unauthenticated attacker may use a malicious link to cause an authenticated user to execute Nagios commands with that user's permissions.
Affected context
The issue occurs in Nagios web interfaces that use a double-submit cookie mechanism for CSRF protection without establishing that the cookie was created by the application. It becomes risky when an authenticated user with command-execution privileges visits attacker-controlled content or follows a crafted link.
Exploit preconditions
- Attack surface: Nagios Core or Nagios XI web interface
- Required access: No direct Nagios authentication is required by the attacker; an authenticated victim must be induced to make the request
- Trigger point: A state-changing request that executes or schedules a Nagios command
- Why exploitation is possible: The CSRF check accepts matching cookie and request parameter values that can be supplied by the attacker, allowing the intended origin and user-intent assumptions to be bypassed
Why this happens
The vulnerability results from an improperly implemented double-submit cookie defense. The application relies on attacker-controllable cookie and request parameter values matching each other, rather than ensuring that the token is unpredictable, application-generated, and bound to the user session or request context. This behavior maps to CWE-352: Cross-Site Request Forgery, because a remote party can potentially cause an authenticated browser to submit an unauthorized state-changing request.
Potential impact
- Unauthorized Nagios commands may be executed with the victim's privileges
- Monitoring configuration or operational state could be altered
- Services or hosts managed through Nagios may be affected
- The incident could enable further compromise if the victim has elevated permissions
General mitigation guidance
Mitigation generally focuses on making CSRF defenses independent of attacker-controlled values and limiting the consequences of unwanted requests.
Common defensive patterns include:
- Using server-generated, unpredictable CSRF tokens bound to the user session or relevant request context
- Rejecting tokens that are supplied through untrusted cookie-setting paths
- Enforcing appropriate SameSite, Secure, and HttpOnly cookie attributes
- Validating Origin or Referer signals where practical as an additional control
- Requiring explicit confirmation for high-impact command actions
- Applying least privilege to accounts authorized to execute Nagios commands
- Avoiding state-changing operations through methods or interfaces that are easily triggered cross-site
How teams detect issues like this
Organizations commonly detect this weakness through:
- Static analysis and code review for double-submit cookie implementations that do not authenticate token origin
- Tests that attempt state-changing requests with attacker-selected matching cookie and parameter values
- Review of command endpoints for missing or inconsistently enforced CSRF validation
- Web application firewall or gateway policies monitoring cross-site requests to sensitive Nagios actions
- CI security checks requiring CSRF protections for privileged state-changing routes
Automated application security testing tools may help identify inconsistent token validation, but results should be verified against the application's session and cookie behavior.

